Sign in to follow this  
Followers 0
John117

Can anyone tell me why this returns other than ""?

4 posts in this topic

What is the reason that a blank box would return other than blank? Thanks!

CODE
#include <GuiConstants.au3>

#include <file.au3>

$window = GUICreate("Temp", 400, 400,400,400)

$SpamUserName = GUICtrlCreateEdit("0", 200, 5, 30, 19, $ES_WANTRETURN);Left, Top, Right, Bottom

GUISetState()

While 1

if $SpamUserName <> "" then Call("SPAM_USER")

WEnd

Func SPAM_USER()

MsgBox(0, "Message Sent", "'" & $SpamUserName & "'")

EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$SpamUserName will return the control ID of your edit. Use GUICtrlRead to get the contents of the edit.

Edited by mikehunt114

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]

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>
#include <file.au3>

$window = GUICreate("Temp", 400, 400, 400, 400)
$SpamUserName = GUICtrlCreateEdit("0", 200, 5, 30, 19, $ES_WANTRETURN);Left, Top, Right, Bottom


GUISetState()
While 1
    If $SpamUserName <> "" Then Call("SPAM_USER")
WEnd


Func SPAM_USER()
    MsgBox(0, "Message Sent", "'" & GUICtrlRead($SpamUserName) & "'")
EndFunc

Use GuiCtrlRead() to read the control. The '3' is the ControlID.

Share this post


Link to post
Share on other sites

That works!

MsgBox(0, "Message Sent",GUICtrlRead($SpamUserName))

Thanks- its a little up hill knowing it works in vba and not knowing in autoit

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