SendMessage

Ethyl

New member
Joined
Jun 22, 2006
Messages
1
Programming Experience
Beginner
Hi,

ok i am developing a program at the moment and i am at a hault.

what i need to do is find a app window that contains either the word "topic" or "Video Chat"

then what i need to do is to send text to that app to an edit box and then simulate a keystroke "return" but there is a delay of about 100 milliseconds between the text going into the box and then pressing return

i have never used SendMessage or FindWindow

any help would be appreciated

Thanks
 
This is the function you'll need to find a window by it's title....

VB.NET:
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" 
(ByVal lpClassName As String, ByVal lpWindowName As String) As Int32

It returns a value of integer which will be a handle to the window it found. You may even want to change the return value to intptr.

Then you can use the sendmessage api to well, send it a message. You just need the window handle which you've now got, so you just need the message you want to send.

VB.NET:
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" 
(ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, _
ByVal lParam As Int32) As Int32

Sounds to me though like you will also need an api to find your edit box on the form. Mind if i ask what your trying to accomplich here?
 
Back
Top