VB send information to window handle w/o SendKeys

Here's the skinny -->

* I've a known window handle to where I want to send a piece of data from my pre-existing VB app.
* It is ten characters (all numeric)
* There also needs to be a CR to submit the query.  It is not a web based application.
* Sendkeys = BAAAAD!  

I can grab the window handle, but sending to that window handle (caption, text or window handle) is... ahem... throwing me for a Loop.  Sorry, couldn't resist.  
Who is Participating?
"The SetWindowText function changes the text of the specified window’s title bar (if it has one). If the specified window is a control, the text of the control is changed."

Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Use an API spy...There is one called PAT or JK's API spy, This will give you many options to choose from and to do whatever you want with the windows.  It also will actually write the source code for you so you can simply copy and paste the code into your application.

For what you describe the options you would need are...findwindow,settext,gettext etc..

It's very simple to use give it a try...

download here::

chitterbuttAuthor Commented:
Whats terrible?
Sorry to inform you bit sendkeys is the only terrible thing here buddy
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.