I've been running PPJoyKey for years using batch files to load and kill the application. Here is how to do it.
In this example, I'm using PPJoyKey for playing Virtua Tennis:
1) Install the software and configure the virtual joysticks as normal.
2) Create a shortcut to run PPJoyKey in the application's folder, call in something like "PPJoyKeyVT.lnk".
3) Right-click on the new shortcut to edit the properties, so that it loads the config file you want, e.g.:
"C:\PPkey\PPJoyKey.exe c:\ppkey\virtua1.ini"
You can now double-click on that the new shortcut to make sure it works properly.
However, MameWAH doesn't like launching shortcuts for some reason, so let's wrap that in a batch file:
3) Make a short batch file like this, and call it something like "ppjoykeyVT.bat":
"@ECHO OFF
C:\ppkey\ppjoykeyVT.lnk
EXIT"
That's the launching all worked out.
4) To close the application, we make another batch file (e.g. close.bat) to kill the task from the command line:
"@ECHO OFF
taskkill.exe /F /IM ppjoykey.exe
EXIT"
Now that we have done our batch files, we need to get the MameWAH config right.
5) Edit our MameWAH config (virtua.ini) to launch these batch files as pre- and post- emulator commands (PPJoyKey command lines bolded):
"pre_emulator_app_commandlines c:\PPKey\ppjoykeyVT.bat;c:\utils\daemon\daemon.exe -mount 0,"c:\cdimages\virtua tennis.nrg"
emulator_commandline c:\VTennis\closemul.exe "Virtua_tennis_PC.exe"{nodosbox}{safelaunch}
post_emulator_app_commandlines c:\PPKey\close.bat;c:\utils\daemon\daemon.exe -unmount 0"
That is it! Enjoy!
Zeb.
PS - As you can also see, I also load and unload the Virtua Tennis disk image seamlessly by using Daemon Tools from the command line.