Tys Posted January 17, 2005 Share Posted January 17, 2005 (edited) Hi community, I am trying to get a reaction to a click inside the list control via OnEvent. It does not happen, why is that? One second thing, where are the differences between GUISetOnEvent and GUICtrlSetOnEvent except that GUICtrlSetOnEvent does not get the Windows Close action? /edit, OK, forget the second part, I did read the helpfile again, that helped;) expandcollapse popup#include <GUIConstants.au3> Opt ("GUIOnEventMode", 1) ;------------------------------------------Fill List--------------- GUICreate("RDP/VNC-Selector", 280, 300) $ListClients = GUICtrlCreateList("", 10, 20, 110, 280) For $i = 1 To 5 $Client = "Client" & $i GUICtrlSetData($ListClients, $Client) Next ;----------------------------------------Resolution chooser GUICtrlCreateLabel("Auflösung:", 130, 4) $radio800x600 = GUICtrlCreateRadio("800x600", 130, 20, 120, 20) $radio1024x768 = GUICtrlCreateRadio("1024x768", 130, 36, 120, 20) $radiofullscreen = GUICtrlCreateRadio("Vollbild", 130, 52, 120, 20) ;----------------------------------------Go Button $buttonGo = GUICtrlCreateButton("Start", 216, 270, 60) ;---------------------------------------Set CtrlEvents GUICtrlSetOnEvent($ListClients, "ClientsList") GUICtrlSetOnEvent($radio800x600, "_800x600") GUICtrlSetOnEvent($radio1024x768, "_1024x768") GUICtrlSetOnEvent($radiofullscreen, "Fullscreen") GUICtrlSetOnEvent($buttonGo, "GoButton") GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func GoButton() MsgBox(4096, "GoButton!", "GoButton") EndFunc ;==>GoButton Func ClienteList() MsgBox(4096, "ClientsList", "ClientsList") EndFunc ;==>ClienteList Func _800x600() MsgBox(4096, "800", "800") EndFunc ;==>_800x600 Func _1024x768() MsgBox(4096, "1024", "1024") EndFunc ;==>_1024x768 Func Fullscreen() MsgBox(4096, "Fullscreen", "Fullscreen") EndFunc ;==>Fullscreen Func SpecialEvents() Select Case @Gui_CtrlId = $GUI_EVENT_CLOSE MsgBox(0, "Close Pressed", "ID=" & @Gui_CtrlId & " WinHandle=" & @Gui_WinHandle) Exit Case @Gui_CtrlId = $GUI_EVENT_MINIMIZE MsgBox(0, "Window Minimized", "ID=" & @Gui_CtrlId & " WinHandle=" & @Gui_WinHandle) Case @Gui_CtrlId = $GUI_EVENT_RESTORE MsgBox(0, "Window Restored", "ID=" & @Gui_CtrlId & " WinHandle=" & @Gui_WinHandle) EndSelect EndFunc ;==>SpecialEvents Edited January 17, 2005 by Tys Link to comment Share on other sites More sharing options...
jpm Posted January 17, 2005 Share Posted January 17, 2005 Hi community,I am trying to get a reaction to a click inside the list control via OnEvent. It does not happen, why is that?One second thing, where are the differences between GUISetOnEvent and GUICtrlSetOnEvent except that GUICtrlSetOnEvent does not get the Windows Close action?/edit, OK, forget the second part, I did read the helpfile again, that helped;)expandcollapse popup#include <GUIConstants.au3> Opt ("GUIOnEventMode", 1) ;------------------------------------------Fill List--------------- GUICreate("RDP/VNC-Selector", 280, 300) $ListClients = GUICtrlCreateList("", 10, 20, 110, 280) For $i = 1 To 5 $Client = "Client" & $i GUICtrlSetData($ListClients, $Client) Next ;----------------------------------------Resolution chooser GUICtrlCreateLabel("Auflösung:", 130, 4) $radio800x600 = GUICtrlCreateRadio("800x600", 130, 20, 120, 20) $radio1024x768 = GUICtrlCreateRadio("1024x768", 130, 36, 120, 20) $radiofullscreen = GUICtrlCreateRadio("Vollbild", 130, 52, 120, 20) ;----------------------------------------Go Button $buttonGo = GUICtrlCreateButton("Start", 216, 270, 60) ;---------------------------------------Set CtrlEvents GUICtrlSetOnEvent($ListClients, "ClientsList") GUICtrlSetOnEvent($radio800x600, "_800x600") GUICtrlSetOnEvent($radio1024x768, "_1024x768") GUICtrlSetOnEvent($radiofullscreen, "Fullscreen") GUICtrlSetOnEvent($buttonGo, "GoButton") GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") GUISetState(@SW_SHOW) While 1 Sleep(1000) WEnd Func GoButton() MsgBox(4096, "GoButton!", "GoButton") EndFunc;==>GoButton Func ClienteList() MsgBox(4096, "ClientsList", "ClientsList") EndFunc;==>ClienteList Func _800x600() MsgBox(4096, "800", "800") EndFunc;==>_800x600 Func _1024x768() MsgBox(4096, "1024", "1024") EndFunc;==>_1024x768 Func Fullscreen() MsgBox(4096, "Fullscreen", "Fullscreen") EndFunc;==>Fullscreen Func SpecialEvents() Select Case @Gui_CtrlId = $GUI_EVENT_CLOSE MsgBox(0, "Close Pressed", "ID=" & @Gui_CtrlId & " WinHandle=" & @Gui_WinHandle) Exit Case @Gui_CtrlId = $GUI_EVENT_MINIMIZE MsgBox(0, "Window Minimized", "ID=" & @Gui_CtrlId & " WinHandle=" & @Gui_WinHandle) Case @Gui_CtrlId = $GUI_EVENT_RESTORE MsgBox(0, "Window Restored", "ID=" & @Gui_CtrlId & " WinHandle=" & @Gui_WinHandle) EndSelect EndFunc;==>SpecialEvents<{POST_SNAPBACK}>Func ClienteList() -> Func ClientsList() Link to comment Share on other sites More sharing options...
Tys Posted January 17, 2005 Author Share Posted January 17, 2005 Func ClienteList() -> Func ClientsList()<{POST_SNAPBACK}>Duh, gaga me;) Thanks for lending me two more eyes! Link to comment Share on other sites More sharing options...
Administrators Jon Posted January 17, 2005 Administrators Share Posted January 17, 2005 Methinks I should put in a check for invalid functions! Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
SlimShady Posted January 17, 2005 Share Posted January 17, 2005 That would be very handy. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now