I'm trying to use #IfWinExist with my GUI to have active hotkeys only when the GUI is active, but unfortunately I'm not figuring out how to get this to work.
Also is it possible to have duplicate hotkeys while #IfWinExist is in affect or not.
Please advise, thank you!
Code: Select all
AOCoverage:
Gui, 2:+AlwaysOnTop +HwndAnalysisHandle +LastFound
Gui, 2:Add, Progress, % "x9 y9 w402 h137 +Disabled Background" . BorderColor . ""
Gui, 2:Add, Picture, x10 y10 w400 h135, %ThemeDir%\Analysis.jpg
Gui, 2:Font, S52 c%TextColor% Underline, Times New Roman
Gui, 2:Add, Text, x40 y150 w350 h80 +BackgroundTrans, ANALYSIS
Gui, 2:Font,S12 Normal Bold, Calibri
Gui, 2:Add, Button, Default x40 y240 w100 h80 gOpen, Partial
Gui, 2:Add, Button, x150 y240 w100 h80 gFinal, Final
Gui, 2:Add, Button, x260 y240 w100 h80 vAfterClose gAfterClose, After close
Gui, 2:Color, %Gui_Color%
Gui, 2:Show,, Analysis
Exit
#IfWinExist ahk_id AnalysisHandle
p::Goto, Open
f::Goto, Final
a::Goto, AfterClose
ESC::Gui, 2:Destroy
Exit
2GuiClose:
Gui,2:destroy
Exit
Open:
Gui,2:submit
Gui,2:destroy
PayType := "Open"
Final:
Gui,2:submit
Gui,2:destroy
PayType := "Final"
AfterClose:
Gui,2:submit
Gui,2:destroy
PayType := "AfterClose"