Microsoft KB Archive/166213

= PRB: Right-Clicking CRichEditView Doesn't Activate Frame =

Article ID: 166213

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 4.1 Subscription

 Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q166213

<div class="notice_section">

<div class="symptoms_section">

SYMPTOMS
If you have a CRichEditView or CRichEditCtrl on a CMDIChildWnd and you right-click the richedit control, focus is set to the richedit control but the frame is not activated.

<div class="cause_section">

CAUSE
The richedit control is not sending a WM_MOUSEACTIVATE message to its parent.

<div class="resolution_section">

RESOLUTION
Override OnMouseActivate in a CRichEditView or CRichEditCtrl and pass this message on to the parent. The MORE INFORMATION section below has code that illustrates this.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

<div class="moreinformation_section">

Sample Code
/* Compile options needed: default */

int CTestView::OnMouseActivate(CWnd* pDesktopWnd,     UINT nHitTest, UINT message) {     const MSG* pMsg = GetCurrentMessage;

GetParent->SendMessage(WM_MOUSEACTIVATE,        pMsg->wParam, pMsg->lParam);

return CRichEditView::OnMouseActivate(pDesktopWnd,        nHitTest, message); }

Keywords: kbrichedit kbuidesign kbdocview kbmdi kbprb KB166213

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.