Outlook intercepts key presses

  • Thread starter Thread starter Paul
  • Start date Start date
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
 
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
 
Back
Top