Code for holding down right mouse button

This is a discussion on Code for holding down right mouse button within the Windows Programming forums, part of the Platform Specific Boards category; Hello all, I just have a quick question: how do you check in your window function if the right mouse ...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    64

    Code for holding down right mouse button

    Hello all,

    I just have a quick question: how do you check in your window function if the right mouse button is being held down? The only solution I can come up with is as follows:

    Code:
    case WM_MOUSEMOVE:
    if(wParam &MK_RBUTTON)
    //do what you have to
    break;
    The only problem with this is that it only responds when the mouse moves (as it should). Is there any other way to check if the right mouse button being pressed (perhaps in a WM_TIMER message)? Many thanks in advance.

    Best,

    Bill

  2. #2
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    idk if this helps, but you can always have a static bool variable that is set to true when the right button is down and set to false when its let up in the WM_RBUTTONDOWN and WM_RBUTTONUP messsages.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    64
    Thank you oh so dearly. It really helped.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simulate Left Mouse Button (VK_LBUTTON)
    By guitarist809 in forum Windows Programming
    Replies: 3
    Last Post: 04-19-2008, 06:05 PM
  2. checking is mouse button is down
    By h_howee in forum Windows Programming
    Replies: 4
    Last Post: 06-30-2007, 10:14 PM
  3. Looking at current mouse button state
    By Lifedragn in forum C# Programming
    Replies: 4
    Last Post: 12-02-2005, 05:52 AM
  4. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 12:33 PM
  5. Mouse button outside of my app?
    By BubbleMan in forum Windows Programming
    Replies: 1
    Last Post: 10-01-2001, 03:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21