Sendkeys is a command in VB that allows you to send keystrokes from your app to the currently active (foreground) application. For example, you can open a blank notepad document, and send something to it like so:
Shell "c:\windows\notepad.exe", vbNormalFocus
Me.Show
DoEvents
AppActivate ("Untitled - Notepad")
SendKeys "hello world"
The problem, is that you need the window to stay behind your application, and therefore, sendkeys will not work.
Now, you can TRY to use the windows API.... which has certain function calls that might help.... one of those function calls is "sendmessage" which allows your program to send a windows message (a hex number that windows understands to do something). Everything that happens to a window, mouse move, mouse down, mouse up is done by a windows message. One of the windows messages, is called "WM_SETTEXT", which has some hex value... pretty nifty huh, WM for windows message, and settext for what it does....
Now, we've just increased our power significantly from sending keystrokes, to sending any kind of message that windows can send....(just about, this isn't the C language, so we have no power in pointers [except addressof, but not really the same]). This leads us to a major problem.... it's all find and dandy, but we have to know the hWnd to send this information to. Every window (mind you, everything in windows is a window.... a textbox, a listbox, a window, a button, they are all a window) every window has an hWnd. An …