Solved

Right Mouse in Dialog?

Posted on 1997-03-05
1
205 Views
Last Modified: 2010-04-10
I am trying to detect a right mouse button click in an edit control within a dialog.  I have coded:
BEGIN_MESSAGE_MAP
     ON_WM_RBUTTONDOWN()
     ...
END_MESSAGE_MAP

-- in dialog class definition --
Protected:
   afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
   ....

-- in dialog class code --
void CSect2::OnRButtonDown(UINT nFlags, CPoint point)
{
   CWnd*  pCurWnd;

   pCurWnd = WindowFromPoint(point);
   if (pCurWnd == GetDlgItem(IDC_ITEM))
  {
      .....
   }
}

In debug mode, I get a break if the mouse click is in the dialog window outside of the edit control, but NO break if mouse click is in edit control.  How do I detect mouse click in edit control ?

Any help is appreciated.  Thanks
0
Comment
Question by:PRoss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
xbwen earned 100 total points
ID: 1162132
 Because the edit control is another window, it the child of the dialog, so you cann't catch the RBUTTONDOWN, you can use EN_CHANGE,EN_UPDATE etc to catch the message from child window.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question