Solved

Inverting the mouse in windows

Posted on 2002-03-28
4
202 Views
Last Modified: 2010-04-02
When my windows app is runnning (minimized) I want the mouse to be "inverted". When the mouse is moved up the pointer moves down and when the mouse is moved down the pointer goes up. But left and right will remain unchanged. Can anyone show me an example of how I can do this?
0
Comment
Question by:kpnkpn
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
mblat earned 100 total points
ID: 6904047
First of all if you app. is minimized you will not get any mouse messages, unless you will capture mouse input with SetCapture or TrackMouseEvent.  But then nobody else will receive them, so what is the point exactly?
Assuming that did get mouse input somehow, (let's say you've installed system hook) you need to handle WM_MOUSEMOVE message in you window.

In that event you need to compare new mouse position with old position (position of the mouse is passed as a parameter in message) and therefore detect if mouse moved up or down.

At this point you can call LoadCursor(....).  For standrad cursor you'll be able to use IDC_ARROW as a parameter, for "reversed arrow", you will need to create custom cursor.  Don't forget to free up resources, this function if poorely writen will eat up GDI resources in hurry.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6906829
kpnkpn-->  I have refunded 100 points to you for the other 3 items inadvertently created when you posted this question and closed them for you.  

http://www.experts-exchange.com/cplusprog/Q.20282670.html
http://www.experts-exchange.com/cplusprog/Q.20282672.html
http://www.experts-exchange.com/cplusprog/Q.20282675.html 

Rather than using the browser controls (F5/Refresh or the back button), please use the Reload function of this application.  Also, hitting submit more than once can cause this problem as well.

Thanks to expert Triskelion, for bringing these to my attention so I could refund all of the above to you.

Moondancer - EE Moderator
0
 
LVL 11

Expert Comment

by:griessh
ID: 6956277
Dear kpnkpn

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "mblat"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6957971
Thank you, finalized today by EE Moderator.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Quicksort a dynamic deque 33 72
how to understand recursion 12 226
C++ question 3 65
How to Correctly derive class from CWinThread in MFC 4 39
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. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

773 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