Solved

Right Mouse in Dialog?

Posted on 1997-03-05
1
197 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
Comment Utility
 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

771 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

12 Experts available now in Live!

Get 1:1 Help Now