Solved

Handling mouse doubleclick in a CEdit

Posted on 1999-01-14
6
991 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand to include initial dialog with two choices. 9 76
matchUp  challenge 6 60
sumHeights2  challenge 7 102
Sed question 2 83
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

816 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

8 Experts available now in Live!

Get 1:1 Help Now