As I know there are only 5 GUI events: GuiClose, GuiEscape, GuiSize, GuiContextMenu and GuiDropFiles.
However, I need something different. Simply saying I want something like this: Wait until user move GUI somewhere (by dragging it with mouse) and then, after it was moved, do SoundBeep.
Is there a way to achieve it?
SoundBeep after GUI moving?
Re: SoundBeep after GUI moving?
Maybe Something like this
Code: Select all
Gui, Add, MonthCal, x2 y9 w360 h310 ,
Gui, Show, w365 h320, MyGui
return
~$*LButton::
WinGetPos, guiXold, guiYold,,, MyGui
return
~$*LButton Up::
WinGetPos, guiX, guiY,,, MyGui
if(guiXold != guiX or guiYold != guiY)
SoundBeep, 500, 500
return
Re: SoundBeep after GUI moving?
Thanks. Yes, I understand, it works correctly, but in my real code I cannot use mouse keys for it. Probably there is another way for it?Qysh wrote:...
Re: SoundBeep after GUI moving?
How about using with settimer?
I wrote down this code from the mobile without any check just from in my memories
So it could be not perfect but i think you could understand it probably
Code: Select all
Gui, add, text, ,text
Gui, show, , MyGui
WinGetPos, GuiXold, GuiYold, , , MyGui
SetTimer,MyGuiCheck,10
Return
MyGuiCheck:
WinGetPos, GuiXNew, GuiYNew, , , MyGui
If (GuiXOld != GuiXNew or GuiYOld != GuiYNew)
SoundBeep, 500, 500
GuiXOld := GuiXNew
GuiYOld := GuiYNew
Return
I wrote down this code from the mobile without any check just from in my memories
So it could be not perfect but i think you could understand it probably
Re: SoundBeep after GUI moving?
All you need is WM_EXITSIZEMOVE:
Code: Select all
Gui Show, w481 h381, Window
OnMessage(0x232, "OnWM_EXITSIZEMOVE")
Return
OnWM_EXITSIZEMOVE(wParam, lParam, msg, hWnd) {
SoundBeep 500, 500
}
GuiEscape:
GuiClose:
ExitApp
Who is online
Users browsing this forum: No registered users and 396 guests