Extremely new to AutoHotkey and I'm using the script below but I want to add a visual indication when the script is running or not running. As an example say when it's toggled to start with the F5 key it would overlay a translucent green dot and when it's stopped it would overlay a translucent red dot and the dot could be moved around on the screen and is always on top. Any help would be appreciated.
Script:
F5::
if !init
{
WinGetActiveTitle, winid
init := 1
}
SetTimer, PressTheKey, % (t:=!t) ? 10000 : "Off"
return
PressTheKey:
ControlSend,, g, %winid%
return
IsPaused := false
Gui, Add, Button, w100 vPauseButton Default, Pause
Gui, Show
return
Script GUI to show when a script is running and active or inactive plus start and stop toggle Topic is solved
Re: Script GUI to show when a script is running and active or inactive plus start and stop toggle
Noone has any ideas on how to do this?
Re: Script GUI to show when a script is running and active or inactive plus start and stop toggle
Try this:
Code: Select all
F5::
if !init
{
WinGetTitle, winid, A
init := 1
DetectHiddenWindows, On
Gui Font, s100
Gui,add,Text,vMyText x-8 y-45 gMove,% Chr(9679)
Gui -Caption +AlwaysOnTop +LastFound
WinSet,TransColor,0xF0F0F0
Gui Show,w70 h70
}
if (t:=!t){
Gui Font, cGreen
GuiControl, Font, MyText
SetTimer, PressTheKey, 10000
} else {
Gui Font, cRed
GuiControl, Font, MyText
SetTimer, PressTheKey, Off
}
return
PressTheKey:
ControlSend,, g, %winid%
return
Move:
PostMessage, 0xA1, 2,,, A
Return
Re: Script GUI to show when a script is running and active or inactive plus start and stop toggle
HotKeyIt wrote:Try this:Code: Select all
F5:: if !init { WinGetTitle, winid, A init := 1 DetectHiddenWindows, On Gui Font, s100 Gui,add,Text,vMyText x-8 y-45 gMove,% Chr(9679) Gui -Caption +AlwaysOnTop +LastFound WinSet,TransColor,0xF0F0F0 Gui Show,w70 h70 } if (t:=!t){ Gui Font, cGreen GuiControl, Font, MyText SetTimer, PressTheKey, 10000 } else { Gui Font, cRed GuiControl, Font, MyText SetTimer, PressTheKey, Off } return PressTheKey: ControlSend,, g, %winid% return Move: PostMessage, 0xA1, 2,,, A Return
It does show the dot and it does toggle color but it's not sending the G key to the window. As a test I opened up notepad and launched the script. The gui color worked like a charm but nothing was being sent to the window. Any idea?
Re: Script GUI to show when a script is running and active or inactive plus start and stop toggle
Works fine for me, are you sure notepad was active when you pressed F5 and you did wait 10 seconds?
-
- Posts: 1
- Joined: 21 Apr 2017, 07:09
Re: Script GUI to show when a script is running and active or inactive plus start and stop toggle Topic is solved
For whatever reason wasn't working but now it is. Thanks so much for the help.HotKeyIt wrote:Works fine for me, are you sure notepad was active when you pressed F5 and you did wait 10 seconds?
Who is online
Users browsing this forum: Auntiejack56, Google [Bot], JoeWinograd, Xtra and 148 guests