Tutorial :Parent window intercepting accelerator



Question:

I have a window that I've placed into another application. In this case, I have a custom application that I injected into a Outlook 2003 Window.

I'm having an issue where the parent window (Outlook in this case), is getting WM_COMMAND messages when I press the backspace key in my application. From my limited Win API experience this seems to indicate that the parent thinks the backspace key is an accelerator and is processing it before my application can see it.

I am experimenting with the LoadAccelerators function to try to get Outlooks accelerator table, but I don't know how I can get the table for the parent window.

Any ideas?

EDIT: Here is the output from spy++ when I hit the backspace key:

WM_COMMAND wNotifyCode: 1 (sent from an accelerator) wID: 1405

I do notice that my textbox gets WM_KEYDOWN's when the backspace key is pressed. Here is the Spy++ line for that message:

P WM_KEYDOWN nVirtKey: VK_BACK cRepeat: 1 ScanOcde:0EfExtended:0fAltDown:0fRepeat:0fUp:0

Thanks.


Solution:1

You're injecting your code into the Outlook process? Sounds kind of nefarious... Anyway, accelerator tables are not actually associated with a window. They're handled by the application's message pump (see the TranslateAccelerator function). I'd say your best bet is to use a message hook. If you see a delete key down message targeted at your window, post another private message to your window and eat the original so Outlook doesn't see it.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »

1 comments:

Write comments
Ella lily
AUTHOR
18 June 2018 at 17:24 delete

pleasant post, stay aware of this fascinating work. It truly regards realize that this subject is being secured likewise on this site so cheers for setting aside time to talk about this! itunes.apple.com/us/app/parental-control-app-kidslox/id914825567

Reply
avatar