Author Topic: Autoit: Start program in background shift focus after x seconds  (Read 37 times)

rand0m

  • Full Member
  • ***
  • Posts: 27
    • View Profile
Autoit: Start program in background shift focus after x seconds
« on: September 18, 2018, 11:24:44 AM »
Demul is a special case in emulators where (afaik) pure command-line is not possible because Demul only accepts commands once its GUI is activated, bad for immersion because you don't go to game directly from AM and DEMUL GUI pops up. I'm using following for Gaelco via Demul:

#include <Misc.au3>
#include <_IsPressed360.au3>
$dll = DllOpen("xinput9_1_0.dll")
ShellExecute(@ScriptDir & "\demul.exe", ' -run=gaelco -rom="' & $CmdLine[1] & '"')
WinWaitActive("gpuDX11oldhw", "")
Send("!{ENTER}")
MouseMove(1920, 540, 0)
While 1
    If _IsPressed360("65536", $dll) And _IsPressed360("-32768", $dll) Then
      ProcessClose("demul.exe")
      ExitLoop
    EndIf
WEnd
DllClose($dll)


This script (made into an exe) works Ok. It opens demul, auto maximizes and hides the cursor but doesn't hide DEMUL GUI. Is it possible in this setup through additional commands that autoit opens demul in background and only shifts focus to Demul after 5 seconds when game starts so I don't see the Demul GUI?

hermine.potter

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
« Last Edit: September 20, 2018, 05:36:26 AM by hermine.potter »
AM Version : 2.4.0
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy