CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    7

    Getting mouse button status if own program is not active

    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


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Getting mouse button status if own program is not active

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured