?
Solved

Right Mouse in Dialog?

Posted on 1997-03-05
1
Medium Priority
?
208 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 300 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

Technology Partners: 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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

719 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