Advertisement

Mouse click problem

Started by January 30, 2000 02:41 PM
2 comments, last by QWERTY 24 years, 8 months ago
If the mouse button is pressed, Windows send WM_LBUTTONDOWN message to application where the mouse click occures. My problem is to determine if the left mouse button is down wherever on the screen even outside of my application window. I know windows hook system might help, but how to use it? Is there another way to do it? For example some memory address where the state of mouse buttons is stored? Please help me. Thanks in advance.
I''ve been doing something like this at work, and the way I got around it was processing the WM_KILLFOCUS message. After all, if you click anywhere on the screen outside of your app, you lose focus in that window.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Advertisement
Thank you for replying felisandria, but I still have a problem. Processing the WM_KILLFOCUS message helps me to determine only one click. But after my application lost focus I need to continue determining the left mouse button state. My task is to create the funny application where the skeleton tracks mouse cursor around the whole screen and if the left mouse button is pressed he makes an action (fires a gun or something). What can I do with it?



Edited by - QWERTY on 1/30/00 4:18:47 PM
Try using GetCursorPos for the mouse position, and GetAsyncKeyState with VK_LBUTTON for the mouse clicks.

Good luck

Starfall

This topic is closed to new replies.

Advertisement