File run when GUI button released. Topic is solved
-
- Posts: 1
- Joined: 13 Jan 2018, 16:07
File run when GUI button released.
I would like to know how to have a file run when a GUI button is released. I am very new to AHK, so any help would be much appreciated. I have tried using KeyWait, but it doesn't appear that KeyWait works with GUI buttons.
Re: File run when GUI button released.
Why when the button is released instead of when the button is pressed?
As Bobo suggested OnMessage probably would be better.
But this should work also when the left button is released.
As Bobo suggested OnMessage probably would be better.
But this should work also when the left button is released.
Code: Select all
gui, add, button,,Continue
Gui, show, autosize
return
~lbutton up::
MouseGetPos,,,,Control
if Control = button1
goto ButtonWasReleasedLabel
return
ButtonWasReleasedLabel:
MsgBox continue button was released
return
GuiEscape:
exitapp
Last edited by DataLife on 13 Jan 2018, 17:12, edited 1 time in total.
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
Re: File run when GUI button released. Topic is solved
Here is an example using OnMessage
Code: Select all
OnMessage(0x201, "WM_LBUTTONDOWN")
gui, add, button,,Continue
Gui, show, autosize
return
WM_LBUTTONDOWN()
{
MouseGetPos,,,,Control
if Control = button1
gosub ButtonWasReleasedLabel
return
}
ButtonWasReleasedLabel:
MsgBox button was released
return
GuiEscape:
exitapp
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
Who is online
Users browsing this forum: tabr3 and 144 guests