Solved

Handling mouse doubleclick in a CEdit

Posted on 1999-01-14
6
983 Views
Last Modified: 2013-11-20
My CFormView class needs to handle the WM_LBUTTONDBLCLICK message from a CEdit control.  How can I effect this ?
0
Comment
Question by:xn12z9i
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:nil_dib
ID: 1327705
Your CEdit control is used within an CEditView?
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1327706
You need to subclass the edit control with your own CEdit-derived class.  Then, in that subclassing, just handle WM_LBUTTONDBLCLICK messages.

See the DOUBLEEDIT.ZIP sample at http://www.nwlink.com/~mikeblas/samples/ for complete source code to do what you want.

B ekiM
0
 

Author Comment

by:xn12z9i
ID: 1327707
This isn't quite what I need to know. What I need is a way for the CFormView class to handle any double-click events that occur in the CEdit client area.  Thanks, though!
0
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.

 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1327708
Actually, the sample shows you exactly what you need to do.

If you don't think it does, you'll need to be more explicit about the difference you perceve between what you're asking and exactly what the sample I wrote for you does.

B ekiM

0
 

Author Comment

by:xn12z9i
ID: 1327709
OK. What I need is for the CFormView (the control's parent) to receive notification that a double-click event has occurred in a CEdit control. What I saw in your code sample was the double click event being handled by the CEdit derived class (i.e., the message map was in the CEdit class, etc). Please let me know if what I want to do is doable with your sample code. Thanks for your help !
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1327710
When you double-click on an edit control, Windows sends the doulbe-click message (WM_LBUTTONDBLCLK) to the edit control. The edit control does not send a parent notification as a result of the message.

Thus, you need to subclass the control and handle the WM_LBUTTONDBLCLK to know that the control has been double-clicked.  If you want to send a message to the parent in response to the message, you're completely free to do so.

In my sample, I post a message box.  If you want to send a message, juts remove the message box call. Then, you can get the parent with a call to GetParent(), then send whatever message you would like to the parent.

B ekiM


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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 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

18 Experts available now in Live!

Get 1:1 Help Now