Jump to content

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


Recommended Posts

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

Link to comment
Share on other sites

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

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