Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Handling mouse doubleclick in a CEdit

Posted on 1999-01-14
6
Medium Priority
?
1,052 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
Independent Software Vendors: 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!

 
LVL 11

Accepted Solution

by:
mikeblas earned 200 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

Hire Technology Freelancers with Gigs

Work with 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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

876 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