Well, if it's in your program can't you just use the normal VB syntax?:confused:VB Code:
MsgBox txtMyTextBox.Text
Printable View
Well, if it's in your program can't you just use the normal VB syntax?:confused:VB Code:
MsgBox txtMyTextBox.Text
It is not in my program. What I want to do is check the message box of another program and click on its button. I have the code to do the check for the program and the click. I just need to be able to check the message now.
Here ya go.
PHP Code:Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
public function gettext(hwnd as long) as string
Dim sz as integer
sz=SendMessage(hwnd,WM_GETTEXTLENGTH,0,0)
sz=sz+1
call SendMessage(hwnd,WM_GETTEXT,sz,gettext)
end function
public sub settext(hwnd as long, text as string)
SendMessage(hwnd,WM_SETTEXT,0,text)
end sub
'To set a string, do this:
call settext(Text1.hwnd,"This is the new text")
'To get a string, do this:
text = gettext(Text1.hwnd)
'There ya have it! Of course, you COULD do this:
Text1.text = "This is the new text"
'and
text=Text1.text
'But, the API version is much more fun, doncha think?
Thanks I will try this :)