Article ID: 190044 - Last Review: May 12, 2003 - Revision: 2.0

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

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q190044
Expand all | Collapse all

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.

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.

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;
}
				

STATUS

This behavior is by design.

REFERENCES

For additional information, please see the following article in the Microsoft Knowledge Base:
179696  (http://support.microsoft.com/kb/179696/EN-US/ ) PRB: Focus and Tab Issues with ATL Subclassed Edit Control


APPLIES TO
  • Microsoft Internet Explorer 3.02
  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Internet Explorer 5.0
  • Microsoft Internet Explorer 5.01
  • Microsoft Internet Explorer (Programming) 5.01 SP1
  • Microsoft Internet Explorer 5.5
Keywords: 
kbctrl kbnofix kbprb KB190044
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.