Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SendMessage API

Status
Not open for further replies.

penahill

Programmer
Joined
Nov 5, 2001
Messages
9
Location
US
I need to find a window and then fill in some text and the click on the OK/Save button. I am able to find the window by using EnumWindowsProc. I think I need to use the SendMessage function but in the declaration the wMsg is declared as a long but I need to pass a string.

I need to pass the string from a VB program to a non VB window and then click on the OK/Save button.

Any help would be greatly appreciated.

Thanks
penahill

 
The message is a Microsoft predefined message (and is a long, not text).

if you want to send text to another program (for instance, filling text into a textbox), you are going to send a WM_SETTEXT message using SendMessage. The parameter is the text (long pointer to the null-terminated text which VB will magically do for you for free) that you want the textbox to be set to:

Take a look here:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top