I have this issue too generaly on lot of arcade game, it's because they are using loader.
This kind of application, are application that launcch application that launch other applications, ect ....
The script probably kill an application (that make you return to windows) but another one is still running (and mGalaxy is waiting for this one is closing)
Something you can do is using the "process manager", and look wich one is still running, if you find the good one, mGalaxy will return back.
If I m right, the better solution is using a custom script, with the application name "in hard" in the script.
Or more often, mGalaxy is back "to fast", because it was monitoring the loader and not the real application, here I have an exemple of a personnal script, it's an old one but it can perhaps help you.
It's the one I m using for windows application (with cmd.exe) but inside you can find a "patch" used for tetris
;Parsing
Local $count = StringInStr($CmdLineRaw, ".exe", 0 , 1, 1)
local $app = StringLeft ( $CmdLineRaw, $count + 4 )
local $command = StringTrimLeft( $CmdLineRaw, $count + 4 )
if not $command then exit 0
;Get more info
$count = StringInStr($command, '"', 0 , 1, 1)
local $link = StringTrimLeft ( $command, $count )
$link = StringTrimRight ( $link, 1 )
Local $aDetails = FileGetShortcut($link)
If @error Then exit
local $tmp = StringSplit($aDetails[0], "\")
local $apptorun = $tmp[$tmp[0]]
;run command
;Run ('"' & $app & '" ' & $command)
ShellExecute('"' & $link & '"')
;wait for application launched with protection loop
;wait for 5 s and exit if no application found
local $protloop = 10
While not(ProcessExists($apptorun))
$protloop = $protloop - 1
if ($protloop < 0) then exit 0
sleep(500)
WEnd
;try to put in front
local $PID = GetProcessPID($apptorun)
local $WinName = ProcessGetWindow($PID)
WinSetState($WinName,"",@SW_SHOW)
WinSetState($WinName,"",@SW_ENABLE)
;wait for close
While (ProcessExists($apptorun) or (ProcessExists("cmd.exe")))
sleep(500)
WEnd
;To resolve bug in taito Xom Tetris gran master
local $list = ProcessList("game.exe")
if $list[0][0] > 0 Then
local $PID = $list[1][1]
ProcessWaitClose($PID)
endif
Exit 0
It's an extract, can share missing fonction if needed, but you can find them on mGalaxy scripts.
If mGalaxy is still freezed (waiting for a special application is closed) it's the first issue, if mGalaxy is running (it have missed the full screen return) it's the second one.