Sign in to follow this  
Followers 0
DotJock

$GUI_EVENT_CLOSE

6 posts in this topic

Several versions back of AutoIT3, I was successfully using "$Case $msg = $GUI_EVENT_CLOSE" in a Select loop. With the current version I'm getting the error: "==> Variable used without being declared.:" Any suggestions on a fix? >_

Share this post


Link to post
Share on other sites



Hi Appie,

Thank you for the reply.

I'm getting the same error with script you just provided:

==> Variable used without being declared.:

DotJock

Hi DotJock,

The "$Case" should be "Case".

Try this!

While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
EndSelect
WEnd

Appie

Share this post


Link to post
Share on other sites

Hi Appie,

Thank you for the reply.

I'm getting the same error with script you just provided:

==> Variable used without being declared.:

DotJock

Try this I tested it and it worked!!

You probably forgot the "#include <GUIConstantsEx.au3>"

#include <GUIConstantsEx.au3>

GUICreate("Test", 100, 100)
GUICtrlCreateLabel("Test Window", 10, 10)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

Electron microscopes rule!!!

Share this post


Link to post
Share on other sites

Thanks Appie, that did it. Guess I was having another “geriatric moment.” Interesting though, in an older version of AutoIT3, I didn’t need “#include <GUIConstantsEx.au3>” to make “Case $msg = $GUI_EVENT_CLOSE” work. Anyway, now I know I do.

Thanks again.

Share this post


Link to post
Share on other sites

Thanks Appie, that did it. Guess I was having another “geriatric moment.” Interesting though, in an older version of AutoIT3, I didn’t need “#include <GUIConstantsEx.au3>” to make “Case $msg = $GUI_EVENT_CLOSE” work. Anyway, now I know I do.

Thanks again.

The default includes had a lot of changes in v3.2.12.0. Read more in helpfile by searching for "script breaking changes" and look at the second topic.

Share this post


Link to post
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
Sign in to follow this  
Followers 0