If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

What did you want to achieve with this code and what do you mean by "works perfectly"?

Maybe some back ground info about my program will help with the big picture.
I have designed a small "macro" program that helps me to find and right click on a series of drop down menus to "shortcut" myself to an end menu with a single hotkey press.
Eg. when I press "F1" it will search and find Option 2 from menu 1, then option 1 from menu 2, then option 12 from menu 3.
To achieve this, I currently find the image, and have my program move the mouse to the desired X & Y co-ordinates with the MOUSE_EVENT code snippet I attached above.

Originally Posted by Arjay

The correct way to do mouse and keyboard input is to use the SendInput api.

Arjay is right about the correct way to move the mouse being SendInput. (also the easiest and simplest)

Originally Posted by VictorN

Why "to avoid using the MOUSE_EVENT function"? what is wrong with it?

Both Mouse_Event and SendInput leave Injected flags which I am trying to avoid.

I have decided to try and learn how to move the mouse using a mouse filter driver.
I am currently stuck on this part.

MOUSE_INPUT_DATA structure and MouseClassServiceCallback are used by driver routines - not user-level programs.

[Thread moved to Driver Development]

All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.