Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Capturing mouse without Drag

Posted on 2003-03-26
8
Medium Priority
?
167 Views
Last Modified: 2013-11-20
Hi All,
     I've been trying to have my dialog based Application keep the mouse Focus as a User Clicks a certain point. Here is what the Application should do when the User Clicks certain area.
1. The Mouse Capture Should be Set to the Window even if the Button is Released.
2. The Window Should recieve all Mouse Messages even if Mouse Pointer is not over the window. i.e even if mouse is over any other application or desktop, Application should Recieve its messages.
3. Once Clicked again and Mouse is Already Captured the Capture Should be released.
       
    Help will be appriciated.
0
Comment
Question by:UsmanAnsari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 3

Expert Comment

by:aphillips
ID: 8212977
Typically when capturing the mouse you capture (using CWnd::SetCapture()) in the mouse down event and release in the mouse up event.  There is no requirement you do it that way.

You want to capture on the first mouse down event, then release on the next mouse down event.

This may be confusing to the user if they do not realise they are in some special state.  I recommend that you change the mouse cursor while you have the mouse captured to indicate the special state.
0
 

Author Comment

by:UsmanAnsari
ID: 8217038
Yup that is What I want to Do but the Problem is how do it? as i capture mouse with SetCapture Method once the mouse goes out of the "vision" of the window that has captured it. the Window no longer recieves mouse's messages.
 So what i want is to have the window keep recieving messages even if the mouse is on some other window.
0
 

Expert Comment

by:FrenchFries
ID: 8217541
If the mouse pointer moves out of the client area you can check WM_NCMOUSEMOVE /CWnd::OnNcMouseMove  messages.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:aphillips
ID: 8220364
Once you capture you should get mouse move messages even if the mouse is moved off the window.  You may stop getting them if the user manages to change the focus to another program.
0
 

Author Comment

by:UsmanAnsari
ID: 8222917
Check out Zoom+ at
http://www.gipsysoft.com/zoomplus/index.shtml
He manages to get Mouse messages even if any other window is activated. this is something i had in mind for myself.
although the source code is provided but I'm having a hard time figuring it out. Help any one...
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11834295
PAQed, with points refunded (20)

modulo
Community Support Moderator
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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 …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

704 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