tags:

views:

130

answers:

1

Hi, 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.

A: 

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.

Peter Ruderman
Ever used Xobni? They do the same thing. The API for Outlook is rather limited for 2003. 2007 is a somewhat different story though.Thanks for the help, I'll check that out.
Max
I have to agree that this is a quite common way to integrate into outlook.
76mel