WinAPI: No WM_COMMAND Message?
Hello!
I'm trying to remote control an application using SendMessage. When you send ALT+P to that application, it does what it should do, but I want to control it directly by sending a message. So I do NOT want to send KEYDOWN and KEYUP messages, but the message that invokes the proper function (normally WM_COMMAND). Instead, there are hundreds of strange other messages within less than one second. The problem with this app is: There are no WM_COMMAND messages, like in 'normal' applications, so I'm a bit confused :mad: Maybe some API-expert can help me? This is what happens after lifting the last key (press ALT, press P, lift P, lift ALT): Code:
<00040> 0024094C P WM_KEYUP nVirtKey:VK_MENU cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1 http://home.scarlet.be/~lb178476/test1.txt http://home.scarlet.be/~lb178476/test2.txt http://home.scarlet.be/~lb178476/test3.txt Thanks in advance! /Edit: Additional information: The application is written in Delphi and uses the SpTBXLib (http://club.telepolis.com/silverpointdev/index.htm). |
I think the key might be here:
Code:
<00174> 0024094C P WM_SYSKEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:00 fExtended:0 fAltDown:1 fRepeat:0 fUp:0 Afterwards, you press P. This is the moment that things get done, when the key goes down and not up. Of course this always ends up being a decision of the developer, but for menus for instance, they appear when the key goes down and not up. Anyway, when P goes down there is this message once again, USER+43764, this time with wparam=50. Have you tried sending this message? If you have, have you also tried sending it first with wparam=12 (ALT down), then with wparam=50 (P down)? I believe the developer might have implemented triggering the action on the equivalent of the OnKeyDown event: if Key = 'P' then .... Which leads me to another suggestion. How about sending the WM_SYSKEYDOWN messages yourself? The WM_USER messages might be just for other stuff, maybe the action you want is executed directly in the key down event, without resorting to any further message exchanges. |
Hmm, obviously the WParam is just the value of the virtual key scancode, as you can see here:
Code:
{ Virtual Keys, Standard Set } Sending that myself works: Code:
SendMessage($C0A52, WM_USER+47364, VK_MENU, $20000001); |
All times are GMT +8. The time now is 23:41. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX