Thread: Hold Mouse Click

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    20

    Hold Mouse Click

    How would I write a function in c++ to hold a mouse click for a given amount of time and then release? Thank you in advance for any help.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Quote Originally Posted by zach0616
    How would I write a function in c++ to hold a mouse click for a given amount of time and then release? Thank you in advance for any help.
    What operating system? Using the Win32 API, you'd send messages about mouse events.
    Away.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    20
    Yes I'm using windows. Sorry for not stating that.I understand that WM_LBUTTONDOWN is for a left click, but what about holding it for a certain amount of time?
    Last edited by zach0616; 07-06-2005 at 08:11 PM.

  4. #4
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    tra-la-la MSDN

    edit: Darn you for changing your post around on me. Try setting a timer (SetTimer()), sending WM_LBUTTONDOWN, and sending WM_LBUTTONUP when the timer expires.
    Last edited by confuted; 07-06-2005 at 08:15 PM.
    Away.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem in mouse position
    By Arangol in forum Game Programming
    Replies: 6
    Last Post: 08-08-2006, 07:07 AM
  2. Replies: 2
    Last Post: 03-23-2006, 07:08 AM
  3. Using mouse click
    By kakashi in forum C++ Programming
    Replies: 10
    Last Post: 01-31-2006, 01:38 AM
  4. Making a Mouse Click
    By r0ss in forum C Programming
    Replies: 1
    Last Post: 06-03-2004, 08:55 PM
  5. mouse click coords and moving a rect
    By techrolla in forum Windows Programming
    Replies: 1
    Last Post: 03-07-2004, 09:49 PM