NeuralJack
Well-known member
- Joined
- Jul 28, 2005
- Messages
- 138
Hey yall, this is my first post. I came here because it seems like great forums with active knowledgable people. I usually find my answers to all my VB.Net questions through hours or days or weeks of searching the internet, and I usually find my answer. But this question has been plaguing me for over a month so its time to bite the bullet.
What I need to do is sendkeys to a non-active window. The SendKeys and keybd_event commands only seem to send it to the windows environment in general, so it sends the key to the active window. Is there a way to send it to a non-active window? I already have code that successfully gets me the window handler, so thats all fine and dandy.
With some research I think that either the SendMessage or SendInput API should do what im looking for. The problem is all of the documentation i see on these APIs have their examples set in VB6 or earlier and I cant see them used in .NET at all - and im pretty sure that they are used differently in .NET. I tried to use them as they did in VB6 with no luck, and ive tried many other variations to .Net-ify it and nothing worked.
Can someone just throw me a few lines of ultra simple code that would show me how to do what im looking for? Remember I have the window Handle already, I just need to send it a key (lets say a "w") WITHOUT first making it the top window or activating that window. So, no SetForgroundWindow API please
What I need to do is sendkeys to a non-active window. The SendKeys and keybd_event commands only seem to send it to the windows environment in general, so it sends the key to the active window. Is there a way to send it to a non-active window? I already have code that successfully gets me the window handler, so thats all fine and dandy.
With some research I think that either the SendMessage or SendInput API should do what im looking for. The problem is all of the documentation i see on these APIs have their examples set in VB6 or earlier and I cant see them used in .NET at all - and im pretty sure that they are used differently in .NET. I tried to use them as they did in VB6 with no luck, and ive tried many other variations to .Net-ify it and nothing worked.
Can someone just throw me a few lines of ultra simple code that would show me how to do what im looking for? Remember I have the window Handle already, I just need to send it a key (lets say a "w") WITHOUT first making it the top window or activating that window. So, no SetForgroundWindow API please