Jump to content

it worked 5 seconds ago! >_<


Recommended Posts

i'm poking the gui part of the help file.

behold, a piece of code:

$msg=GuiGetMsg()

select
case $msg=$GUI_EVENT_CLOSE
exitloop
case $msg=$button_1
run("notepad.exe"
send("you want to kill me, you bastard?! D:")
exitloop
endselect

this is part of the help file (a bit tweaked though). IN THEORY, this should work flawlessly.

and yet, autoit whines that $GUI_EVENT_CLOSE was either not declared or declared earlier.

this, of course, makes me quite upset because the help file is officially not helpful on the topic.

how do i fix this issue?

also, copying the help file gives the same result. "$GUI_EVENT_CLOSE was declared earlier, blah blah blah blah."

Link to comment
Share on other sites

i'm poking the gui part of the help file.

behold, a piece of code:

$msg=GuiGetMsg()

select
case $msg=$GUI_EVENT_CLOSE
exitloop
case $msg=$button_1
run("notepad.exe"
send("you want to kill me, you bastard?! D:")
exitloop
endselect

this is part of the help file (a bit tweaked though). IN THEORY, this should work flawlessly.

and yet, autoit whines that $GUI_EVENT_CLOSE was either not declared or declared earlier.

this, of course, makes me quite upset because the help file is officially not helpful on the topic.

how do i fix this issue?

also, copying the help file gives the same result. "$GUI_EVENT_CLOSE was declared earlier, blah blah blah blah."

Looking at the examples in the help file you will find that the files that have to be #included are always there.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

amazingly.... none of your suggestions helped.

instead, i needed to make it

while 1

$msg=$GUI_EVENT_CLOSE

and it worked o.o;

i think i broke autoit. yay.

Are you trying to say that you didn't have any of that code in a While loop? If thats the case then it would never work.

While 1
   $Msg = GuiGetMsg()
   Switch $Msg
      Case $GUI_EVENT_CLOSE
         exitloop
      Case $button_1
         run("notepad.exe")
         send("you want to kill me, you bastard?! D:")
         exitloop
   EndSwitch
WEnd

BTW, your Send() probably won't work either since you have to wait for the window before you can send anything to it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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...