(Vb.net)Send keys / messages to unfocused/minimized window
I am working on little project that i need to send messages to a window that did not have focus. I had done this before in the past, but from then to now, i got a little rusty on my skills. I decided to write up this little project to give myself a nice “Refresher”.
in this example i am looping through all of the running process looking for “notepad”. when its found, i start looping through all of its controls looking for the “Edit” control (the big white textbox). When i find the handle to that control, i can the send a message to it (in this case its a string). I loop through each character in the string and send it to the control character by character then send the “Enter” key once the loop is over with.
Hopefully there will be someone else that can find this useful, and i would like to give a “Thanks” to the guys over a Pinvoke.net for their time and effort in putting that site together.