Click to See Complete Forum and Search --> : Getting mouse button status if own program is not active


Felix Haas
April 2nd, 1999, 11:45 AM
Hi,

I am programming a program at school that must check if the user is pressing down the middle mouse button. Now, you would say, this is easy, BUT: My program is running invisible and must get the mouse button status at ALL times (also if my program is not active).

Do you have any idea if there is an API function or another way to get the mouse button status? Any help is appreciated!!

Thanks a lot in advance,
Felix Haas
Germany

Lothar Haensler
April 7th, 1999, 02:30 AM
you could use the SetWindowsHookEx API function with a hook id of WH_MOUSE to trap ALL mouse messages. You need VB 5 or 6, because you have to pass the address of the hook procedure to that API call.