|
-
Dec 10th, 2001, 04:25 PM
#1
Thread Starter
New Member
PostMessage
Hey all, I'm writing an app that uses the PostMessage API call to send keystrokes to another app. All is working well except for the keyboard modifiers. How do I send CTRL + key, alt + key, or shift + key to the app?
-
Dec 11th, 2001, 10:30 AM
#2
Thread Starter
New Member
-
Dec 11th, 2001, 11:41 AM
#3
You need to know about scan codes and virtual keys
This explains Alt-
http://msdn.microsoft.com/library/de...2_wm_keyup.asp
Here is more about virtual key code vs scan code
http://msdn.microsoft.com/library/de...binpt_0hfd.asp
-
Dec 12th, 2001, 07:29 AM
#4
Thread Starter
New Member
I already know about keyboard scan codes. I'm sending to another app via postmessage so it doesn't have to be in the foreground. The problem I am having is how to send key combinations of alt + a for example to the app running in the background. I've tried sending WM_KEYDOWN and the scancode for alt, then the scancode for a but it doesn't work, just sends the a.
-
Dec 12th, 2001, 08:30 AM
#5
Conquistador
u need to send something, i think in the lparam?
to simulate alt being pressed.
-
Dec 12th, 2001, 09:41 AM
#6
Thread Starter
New Member
lparam seems to be completely ignored. To test this I even tried making a for next loop to try every # from 0 to 65535. :P
If your curious the program I am trying to send the keystrokes to is Ultima Online.
-
Dec 12th, 2001, 10:14 AM
#7
Not to be a PITA - did you even read the first link? It explains how to handle alt - what you're bitchin' about in the next post/
mmmmmm?
-
Dec 12th, 2001, 10:30 AM
#8
Conquistador
ahh yes, the context key stuff is sent in the wparam
-
Dec 12th, 2001, 11:52 AM
#9
Thread Starter
New Member
Yeah, I read it several times, but I still can't get it to work. Can someone post an example using postmessage? That would be most appreciated.
-
Dec 12th, 2001, 12:17 PM
#10
Thread Starter
New Member
Oh and it isn't just Alt I'm trying to figure out, its ctrl and shift as well, is it even possible to send ctrl +key and shift + key?
-
Dec 13th, 2001, 06:23 AM
#11
Conquistador
i'll do a bit of searching for u
-
Dec 13th, 2001, 04:36 PM
#12
Thread Starter
New Member
Anyone feel like pasting an example or a link that would explain everything?
-
Dec 14th, 2001, 03:51 PM
#13
Thread Starter
New Member
-
Dec 14th, 2001, 08:33 PM
#14
Conquistador
i would suggest having a look on www.planet-source-code.com
someone is sure to have posted a good example
-
Dec 17th, 2001, 08:24 AM
#15
-
Dec 17th, 2001, 09:56 PM
#16
Thread Starter
New Member
Neither of those links had anything related to what I'm trying to do. Is it even possible to send keystrokes (modifier key + key) or capital letters to apps without bringing them into focus?
-
Dec 21st, 2001, 11:00 AM
#17
Thread Starter
New Member
-
Dec 21st, 2001, 12:33 PM
#18
Try http://www.codehound.com/ - it is a VB search engine. If there is any code on the web that does what you are asking, it will find it. Start out with putting PostMessage in the search box and see what kind of returns you get.
-
Dec 27th, 2001, 10:46 AM
#19
Member
I think maybe u can try this :
alt + L = "%L"
alt + F = "%F"
I think it works...
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|