Solved

Inverting the mouse in windows

Posted on 2002-03-28
4
206 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
[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
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

691 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