Jump to content

function creates msgbox but will not create GUI?


Recommended Posts

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 by Hatcheda
Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...