To run Game and Watch exes, I'v tried something simple working:
In the same folder than the games: a ahk script by game:
Run, E:\Nintendo\Game & Watch\Jeux\Banana\Banana.exe
Process, Close, Banana.exe
Anyone knows how to add run Xpadder before launching the game and close Xpadder after closing the game?
Something like Runwait?
Thanks and regards,
Ask gaming related questions
2 posts • Page 1 of 1
Hi doohan and welcolme to the AHK community
Hope this helps.
Ruwaitis actually a relevant option in this case. Here's a commented example using notepad (as Xpadder):
WM_SYSCOMMAND := "0x112", SC_CLOSE := "0xF060" ; values used with PostMessage below - see WinClose > remarks in the documentation
#Persistent ; to keep a script that contains only timers running
SetTimer, mySubroutine, -1 ; runs a timer (a negative period like -1 make the timer run only once). The purpose of running such a timer is here to open a new thread and that way prevent the code beneath - if any - from being postponed by the runwait command
run, %A_WinDir%\system32\notepad.exe,, Min, PID ; runs notepad and stores its unique process ID (PID) in 'PID'; min will run it minimized
; some code...
return ; end of the auto-execute part of the script
mySubroutine: ; subroutine executed by the timer
WinWait, ahk_pid %PID% ; waits until notepad window exists
runwait, "E:\Nintendo\Game & Watch\Jeux\Banana\Banana.exe"
PostMessage, %WM_SYSCOMMAND%, %SC_CLOSE%,,, ahk_pid %PID% ; less forcefull than process, close - similar in effect to pressing Alt-F4 or clicking the window's close button in its title bar.
Hope this helps.
Who is online
Users browsing this forum: No registered users and 6 guests