Solved

Inverting the mouse in windows

Posted on 2002-03-28
4
200 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

744 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

13 Experts available now in Live!

Get 1:1 Help Now