RAMzor
Новичок
- Сообщения
- 15
- Репутация
- 0
Я использую EventMode ГУИ
Как можно реалезовать DoubleCkick на Label ("Hello world!" в моём примере)?
DoubleCkick на любое пустое место получается (смотри консоль) :-[
Как можно реалезовать DoubleCkick на Label ("Hello world!" в моём примере)?
DoubleCkick на любое пустое место получается (смотри консоль) :-[
Код:
#include <GUIConstantsEx.au3>
Global $WM_LBUTTONDBLCLK = 0x0203
Opt("GUIOnEventMode", 1)
$TestGUI = GUICreate("My Test", 300, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")
$Lbl = GUICtrlCreateLabel("Hello world!", 30, 10)
$OkBtn = GUICtrlCreateButton("OK", 10, 30, 50)
GUICtrlSetOnEvent(-1, "OKPressed")
$CancelBtn = GUICtrlCreateButton("Cancel", 0, -1)
GUICtrlSetOnEvent(-1, "CancelPressed")
GUIRegisterMsg($WM_LBUTTONDBLCLK, "WM_LBUTTONDBLCLK")
GUISetState(@SW_SHOW)
; Just idle around
While 1
Sleep(10)
WEnd
Func OKPressed()
ConsoleWrite("OK Pressed " & "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle & @CRLF)
EndFunc ;==>OKPressed
Func CancelPressed()
ConsoleWrite("Cancel Pressed " & "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle & @CRLF)
EndFunc ;==>CancelPressed
Func SpecialEvents()
Select
Case @GUI_CtrlId = $GUI_EVENT_CLOSE
ConsoleWrite("Close Pressed " & "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & @CRLF)
Exit
Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
ConsoleWrite("Window Minimized " & "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & @CRLF)
Case @GUI_CtrlId = $GUI_EVENT_RESTORE
ConsoleWrite("Window Restored " & "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & @CRLF)
EndSelect
EndFunc ;==>SpecialEvents
Func WM_LBUTTONDBLCLK()
ConsoleWrite("#### Double Click On Main Form ####" & @CRLF)
EndFunc ;==>WM_LBUTTONDBLCLK