Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Backspace in ATL Subclassed CTL Causes Internet Explorer to Navigate Back


View products that this article applies to.

This article was previously published under Q190044

↑ Back to the top


Symptoms

When an ATL ActiveX control that subclasses an edit control is hosted in Internet Explorer, pressing the BACKSPACE key when focus is set to the Edit control causes Internet Explorer to navigate to the previous Web page. If there are no Web pages previous to the one with the control, the BACKSPACE key functions as normal.

↑ Back to the top


Cause

When the user clicks on the subclassed control, the control is not UI Activated. This means that any accelerator keys are processed by the Internet Explorer frame. The control is never given a change to process the BACKSPACE accelerator key.

↑ Back to the top


Resolution

When the user clicks in the edit box, a WM_MOUSEACTIVATE message is sent to the control. When this message is received, manually activate the control by calling CComControl::InPlaceActivate(OLEIVERB_UIACTIVATE).

Here is sample code for a WM_MOUSEACTIVATE handler that calls InPlaceActivate to manually UI Activate itself:
LRESULT OnMouseActivate(UINT, WPARAM, LPARAM, BOOL&)
{
   // Manually activate the control
   InPlaceActivate(OLEIVERB_UIACTIVATE);

   return 0;
}
				

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


References

For additional information, please see the following article in the Microsoft Knowledge Base:
179696� PRB: Focus and Tab Issues with ATL Subclassed Edit Control

↑ Back to the top


Keywords: kbctrl, kbnofix, kbprb, KB190044

↑ Back to the top

Article Info
Article ID : 190044
Revision : 2
Created on : 5/12/2003
Published on : 5/12/2003
Exists online : False
Views : 509