John117 Posted July 30, 2007 Share Posted July 30, 2007 (edited) Please, take a look at or test this code and tell me why it can create a msgbox but not a gui? CODE#include <GuiConstants.au3> Opt("MustDeclareVars", 1) Global Const $WM_COMMAND = 0x0111 Global $Edit1 $Form2 = GUICreate("Test Button For Double Click", 716, 561, 155, 134) $Edit1 = GUICtrlCreateEdit("Type Message Here", 10, 30, 230, 60, $ES_WANTRETURN) $Button = GUICtrlCreateButton("Button Test", 10, 100, 89, 41, $BS_NOTIFY) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Func _LoWord($x) Return BitAND($x, 0xFFFF) EndFunc ;==>_LoWord Func _HiWord($x) Return BitShift($x, 16) EndFunc ;==>_HiWord Func MY_WM_COMMAND($hWnd, $msg, $wParam) Local Const $BN_CLICKED = 0; Local Const $BN_DBLCLICKED = 5; Local $nID = _LoWord($wParam) Local $nNotifyCode = _HiWord($wParam) If $nID <> 2 Then Switch $nNotifyCode Case $BN_CLICKED GUICtrlSetData($Edit1, (GUICtrlRead($Edit1)+1)) Case $BN_DBLCLICKED MsgBox(0, "Double", "Click") ;GUICreate("Update Profile", 100, 100) EndSwitch EndIf Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_COMMAND Edited July 30, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
mikehunt114 Posted July 30, 2007 Share Posted July 30, 2007 Either ;Opt("MustDeclareVars", 1) or declare your variables. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
John117 Posted July 30, 2007 Author Share Posted July 30, 2007 I would . . . But I'm not using a variable for the second gui . . .and I turned that check on before posting (After not working) Link to comment Share on other sites More sharing options...
mikehunt114 Posted July 30, 2007 Share Posted July 30, 2007 Oh, that second commented GUI? Add a GUISetState() right after you create it. I still have to turn off declaring the variables, because they aren't declared. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
John117 Posted July 30, 2007 Author Share Posted July 30, 2007 I Suck! Thanks! 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