Close to the bottom of
this thread in the VPForums, there seems to be something similar, which also fixes *some* nag screens that might appear. (The ones that say "Are you legally allowed to play this game" seem to disappear, but the PinMAME one stays.) I'm going to try it out now, as I am also having similar issues with MA and VP9. Don't try the last link (rapidshare, from a user with a single post) as it is dead. I'm working on the second-last link, from a user named "HGPinball", who is an Admin, it seems.
Here are the contents of the ".AU3" file:
; Just a variable that's used repeatedly in dialog boxes, etc.
$title = "Visual Pinball Assistant"
; TESTING
Opt("TrayIconDebug", 1)
; Show oure little balloon
TrayTip($title, $title & " started.", 3, 1)
; Make sure they see it
Sleep(2000)
; Hide our little balloon
TrayTip("", "", 3, 1)
; Search by title exact or class name
Opt("WinTitleMatchMode", 4)
; Now we go into an infinate loop until the user exits from the tray
While 1
; Look for VPinMAME window
If WinExists("Please answer and press OK...") Then
; Found VPinMAME
; Select Yes radio button
ControlCommand("last", "", 228, "Check", "")
; Click OK button
ControlClick("last", "", 1)
EndIf ; VPinMAME window check
; Look for Visual Pinball Player
$Player = WinGetHandle("classname=VPPlayer")
If Not @error Then
; Player found. Check to see if options dialog is open using a partial match anywhere
Opt("WinTitleMatchMode", 2)
$Options = WinGetHandle("Options Menu")
Opt("WinTitleMatchMode", 4)
If Not @error Then ; Options menu is open
; Close options menu by clicking on the OK button.
ControlClick($Options, "", 1000)
EndIf ; Options menu check
; Check to see if player is active
If WinActive($Player) Then ; Player is active
; User is playing. We don't need to do anything else, but we'll sleep for an extended period
Sleep(4000)
Else ; Player is NOT active
; While the player is not the active window, try and make it so
While Not WinActive($Player)
; If not active, sleep for a bit in case it's actually loading the table
Sleep(1000)
; Try and activate it
WinActivate($Player)
WEnd ; Trying to make the player active
EndIf ; Player active check
EndIf ; Visual Pinball Player Check
; Let the system breathe before we loop.
; This slows down VPM detection but doesn't steal as much of the CPU.
Sleep(1000)
WEnd
Configure the executable in the MA Preferences under "Configuration" for "Visual Pinball". In the "Pre-launch" tab, you setup the program to run, and in the "Exit" tab, you select "Close all additional processes started during launch".
(I might just remove a few lines of code from above and recompile it - the 'TrayTip' popup and silence routines aren't necessary if you're using a front end. There's a quick 'blink' from it as you start up, and you don't need to see it in action.) I think it does work, as I didn't have to use the mouse to do anything...
Now, the only 'new' issue I seem to have is that I'm getting a 'Windows has encountered an issue and needs to close' every time I exit a table. Hurm. It seems to only happen when running VP9 through MA, as I just tried running VP9 directly, and didn't have the issue. Edit: A-Ha! Thanks to an old post on the MA forums, it looks like my using "Esc" to exit wasn't a good idea. There's more than a single mapping to exit the VP program, so using "End" works very, very well.
So, that solves that problem. Everything is working well for me now.