Solved

Right Mouse in Dialog?

Posted on 1997-03-05
1
199 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
getting a fire fox page (view page source ) in c++ 6 42
Unresolved External Symbols 3 68
Dialogbox API leak? 18 81
Eclipse IDE - Cannot copy/paste from console output 8 127
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 will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now