Code: Select all
WinGet, save_PID, PID, A
WinGet, save_ID, ID, A
WinGetClass, save_class, A
To save the windows class as save_class.
I then have two guis open on top of this program, which works fine.
Before I close the two guis, I re-activate the progam under save_class, set it to top, and then my two gui's are meant to close in the background using this:
-------------------------------------------------------------------------------------------------
Code: Select all
WinRestore, ahk_id %save_ID%
winactivate, ahk_id %save_ID%
start := A_TickCount
While !WinActive("ahk_class" save_class)
{
now := A_TickCount-start
winactivate, ahk_class %save_class%
if now > 5000
break
}
winset, top, ahk_class %save_class% ;;; Make top so destroy doesn't inturrupt gui destroy
Gui, 1:Destroy
Gui, 52:Destroy
winset, top, ahk_class %save_class%
winactivate, ahk_class %save_class%
----------------------------------------------------------------------
What tends to happen is that the program seems to activate just fine, but then it takes the full 5000 ms to activate the class (Indicating that it never "activates"). And then it places my two GUIS on top for some reason that have a different class than the program. Then the gui's close.