Outlook intercepts key presses

P

Paul

I have created an Outlook add-in using ATL and C++ that brings up a
dialog box when a button on the toolbar is pressed. Once the dialog is
up if the user presses keys such as the delete key or the backspace key
Outlook is intercepting and processing those keys, sometimes deleting
email or doing other unexpected things. This only happens for the edit
boxes that are on the top-level window of the dialog. There are other
edit boxes in a tab control that process key presses fine. How can
make sure my dialog processes the key press and not Outlook? I seem to
remember reading something about this once but cannot find it now.
Thanks,
Paul
 
D

Dmitry Streblechenko \(MVP\)

There is not much you can do about that - I usually install a message hook
(SetWindowsHookEx(WH_GETMESSAGE, ...)), then check if a particular message
belongs to my control. If it does, I send it directly to my control's window
proc and reset the message to WM_NULL to prevent Outlook from processing it.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top