comeonbaby Posted July 6, 2008 Share Posted July 6, 2008 (Sorry about my bad E first).So i want code a script when i click on a button then dislay a message box.But i dont know how to code.I tried to code a script but it's incomplete.Anyone can help me ? thx in advance! #include <GUIConstantsEx.au3> Func test() Global $check GUICreate("alert",300,100) $check = GUICtrlCreateButton("Confirm",100,50,100,30) ; here is my problem, i dont know how to code If GUIGetMsg() Then MsgBox(0,"alet","ok") EndIf GUISetState() While 1 If GUIGetMsg() == $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc test() Link to comment Share on other sites More sharing options...
Valuater Posted July 6, 2008 Share Posted July 6, 2008 Listen for a message in the loop... #include <GUIConstantsEx.au3> Global $check test() Func test() GUICreate("alert", 300, 100) $check = GUICtrlCreateButton("Confirm", 100, 50, 100, 30) GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then ExitLoop If $Msg = $check Then MsgBox(0, "alet", "ok") EndIf WEnd EndFunc ;==>test 8) Link to comment Share on other sites More sharing options...
sandin Posted July 6, 2008 Share Posted July 6, 2008 (edited) #include <GUIConstantsEx.au3> test() Func test() local $check local $gui = GUICreate("alert",300,100) local $check = GUICtrlCreateButton("Confirm",100,50,100,30) GUISetState(@sw_show, $gui) While 1 $msg = GUIGetMsg() switch $msg case $GUI_EVENT_CLOSE guidelete($gui) ExitLoop case $check MsgBox(0,"alet","ok") EndSwitch WEnd EndFunc Edited July 6, 2008 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
comeonbaby Posted July 6, 2008 Author Share Posted July 6, 2008 Thx everybody but i just dont understand why GUIGetMsg() function can listen event of GUICtrlCreateButton() ?? GUICtrlCreateButton() return id of control ?? and GUIGetMsg() return any event have occurred that have a list in help file ? Link to comment Share on other sites More sharing options...
Paulie Posted July 6, 2008 Share Posted July 6, 2008 Thx everybody but i just dont understand why GUIGetMsg() function can listen event of GUICtrlCreateButton() ?? GUICtrlCreateButton() return id of control ?? and GUIGetMsg() return any event have occurred that have a list in help file ?GuiGetMsg() CAN and IS listening for the even of the button created with GuiCtrlCreateButton()It just needs to be in a loop, meaning it has to be consistently checked... 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