Sign in to follow this  
Followers 0
Infinitex0

Gui Help

5 posts in this topic

I know that as soon as someone answeras this that I'll see what I'm doing wrong.

#include <GUIconstants.au3>

GUICreate("Alpha")
$alphavariable1 = GUICtrlCreateButton("Alph info", 50, 50)
GUISetState(@SW_SHOW)

 
 
 $msg = GUIGetMsg()
    Select
         Case $msg = $GUI_EVENT_CLOSE
          Exit
        Case $msg = $alphavariable1 
        MsgBox(4096, "alpha info" ,"info:" & FileReadLine("C:\Documents and Settings\Owner\My Documents\alpha1.txt", 1))
EndSelect

as soon as I activate the script the gui flashes on for a milisecond then closes.


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites



While 1

WEnd

Share this post


Link to post
Share on other sites

While 1

WEnd

thats what i wanted to answer

you just forgot the loop

your whole script should look like this

#include <GUIconstants.au3>

GUICreate("Alpha")
$alphavariable1 = GUICtrlCreateButton("Alph info", 50, 50)
GUISetState(@SW_SHOW)


while 1
$msg = GUIGetMsg()
    Select
         Case $msg = $GUI_EVENT_CLOSE
          Exit
        Case $msg = $alphavariable1 
        MsgBox(4096, "alpha info" ,"info:" & FileReadLine("C:\Documents and Settings\Owner\My Documents\alpha1.txt", 1))
EndSelect
wend

Share this post


Link to post
Share on other sites

Thanks as I said as soon as someone answered this it would be obvious. :)


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Consider using @MyDocumentsDir in place of your hardcoded string.

C:\Documents and Settings\Owner\My Documents

Edit:

To clarify to what your MsgBox line should look like

MsgBox(4096, "alpha info" ,"info:" & FileReadLine(@MyDocumentsDir & "\alpha1.txt", 1))
Edited by MHz

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