Jump to content

$GUI_EVENT_CLOSE


DotJock
 Share

Recommended Posts

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? >_

Link to comment
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!!!
Link to comment
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.

Link to comment
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.
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...