SetTimer Did the trick with notepad.exe, You will need to change the Notepad.exe to H-WoW.exe and the ahk_class notepad parts to whatever ahk_class H-WoW has.
LoadGui:
Gui, Add, Button, x24 y289 w100 h30 gGuiClose, Exit
Gui, Add, Button, x132 y30 w90 h30 gHWoW, Run H-WoW
Gui, Font, S3 CDefault, Verdana
Gui, Font, S5 CDefault, Verdana
Gui, Add, GroupBox, x22 y100 w200 h70 , Choose One
Gui, Show, x266 y125 h338 w235, H-WoW Hotkeys
Return
GuiClose:
ExitApp
HWoW:
Gui, Destroy
Run, Notepad.exe [color=RED]; Change This to H-WoW.exe[/color]
WinWait, ahk_class Notepad [color=RED]; Change This to your H-WoW ahk_class.[/color]
SetTimer, Timer, 100
Return
Timer:
IfWinNotExist, ahk_class Notepad [color=RED]; Change This again to your H-WoW ahk_class.[/color]
{
SetTimer, Timer, Off
Gosub, LoadGui
}
ReturnTell Me if this works the way you need it.
Almost. It doesn't gray the button out.
This is what i have so far...Gui, Add, Text, x172 y310 w50 h20 , ©Apezdr
Gui, Add, Text, x72 y0 w100 h30 +Center, Thanks for using this Macro Tool!
Gui, Add, GroupBox, x12 y60 w210 h210 , Hotkeys
Gui, Add, Text, x22 y40 w60 h20 , Controls
Gui, Add, Text, x23 y82 w64 h15 , Speed Hack
Gui, Add, Text, x32 y110 w60 h20 , Fly Hack
Gui, Add, Text, x32 y140 w70 h30 , Walk On Water
Gui, Add, Text, x22 y180 w70 h30 , Wall Climb
Gui, Add, Text, x22 y210 w70 h30 , No-Clip
Gui, Add, Text, x21 y239 w69 h23 , Reactivate
Gui, Font, S8 CDefault Bold, Verdana
Gui, Font, S8 CDefault Bold, Verdana
Gui, Font, S8 CDefault, Verdana
Gui, Font, S8 CDefault, Verdana
Gui, Font, S8 CDefault, Verdana
Gui, Add, Text, x172 y240 w40 h20 , Ctrl-B
Gui, Add, Button, x24 y289 w100 h30 gGuiClose, Exit
Gui, Add, Text, x172 y210 w40 h20 , Alt-C
Gui, Add, Text, x192 y220 w-50 h-20 , Alt-C
Gui, Add, Text, x172 y180 w40 h20 , Alt-F
Gui, Add, Text, x172 y140 w40 h20 , Alt-X
Gui, Add, Text, x172 y110 w40 h20 , Alt-Z
Gui, Add, Text, x172 y80 w40 h20 , Alt-W
Gui, Add, Button, x132 y30 w90 h30 gHWoW, Run H-WoW
Gui, Font, S3 CDefault, Verdana
Gui, Font, S5 CDefault, Verdana
Gui, Add, GroupBox, x22 y100 w200 h70 , Choose One
Gui, Show, x266 y125 h338 w235, H-WoW Hotkeys
Return
GuiClose:
ExitApp
HWoW:
Run H-WoW.exe
IfWinExist, H-WoW hack
{
GuiControl Disable0, Run H-WoW
}
IfWinNotExist, H-WoW hack
{
GuiControl Disable1, Run H-WoW
}
return
;Hotkey Code Below
!W::
WinWait, H-WoW hack,
IfWinNotActive, H-WoW hack, , WinActivate, H-WoW hack,
WinWaitActive, H-WoW hack,
MouseClick, left, 33, 51
;GuiControl, Cmd ,Check, Button1, H-WoW hack
IfWinExist, World of Warcraft
{
WinActivate ; Automatically uses the window found above.
return
}
return
;Fly Hack Activation
!Z::
WinWait, H-WoW hack,
IfWinNotActive, H-WoW hack, , WinActivate, H-WoW hack,
WinWaitActive, H-WoW hack,
MouseClick, left, 33, 120
return
; Walk On Water
!X::
MouseClick, left, 33, 137
IfWinNotActive, H-WoW hack, , WinActivate, H-WoW hack,
WinWaitActive, H-WoW hack,
return
; Wall Climb
!F::
MouseClick, left, 141, 121
IfWinNotActive, H-WoW hack, , WinActivate, H-WoW hack,
WinWaitActive, H-WoW hack,
return
; NoClip
!C::
MouseClick, left, 141, 137
IfWinNotActive, H-WoW hack, , WinActivate, H-WoW hack,
WinWaitActive, H-WoW hack,
return
; Reactivate
^B::
MouseClick, left, 70, 163
IfWinNotActive, H-WoW hack, , WinActivate, H-WoW hack,
WinWaitActive, H-WoW hack,
WinActivate, H-WoW hack,
returnPay particular attention to the label H-WoW HWoW:
Run H-WoW.exe
IfWinExist, H-WoW hack
{
GuiControl Disable0, Run H-WoW
}
IfWinNotExist, H-WoW hack
{
GuiControl Disable1, Run H-WoW
}
return
This turns the button off when the program is launched. But it doesn't turn it back on when the program is closed. What am I not seeing? Code reference