Thread: Mouse moving

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    1

    Angry Mouse moving

    Hello
    I'm wondering if you could help me with something...i want to move the mouse in Windows from my code(to set it at specific coordinates and move it along the screen, even to click form my code) what should i use...could you explain a little for me ??
    Thank you.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    SetCursorPos will move the cursor to where you want to.

    For left-button click events, handle the following messages in your window procedure:
    WM_LBUTTONDOWN
    WM_LBUTTONBDLCLICK
    WM_LBUTTONUP

    For middle-button click events handle the following messages in your window procedure:
    WM_MBUTTONDOWN
    WM_MBUTTONDBLCLICK
    WM_MBUTTONUP

    For right-button click events handle the following messages in your window procedure:
    WM_RBUTTONCLICK
    WM_RBUTTONDBLCLICK
    WM_RBUTTONUP

    For mouse movement, handle the WM_MOUSEMOVE message.

    There's others; for the full list/explanation of mouse input, read it up on msdn: mouse input overview.

    For cursors there's the cursors overview.
    Last edited by Ken Fitlike; 08-28-2003 at 05:48 AM.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Moving objects with mouse in 3D.
    By psychopath in forum Game Programming
    Replies: 15
    Last Post: 07-10-2011, 04:20 PM
  2. Moving mouse
    By Bill83 in forum Windows Programming
    Replies: 1
    Last Post: 04-02-2006, 08:58 AM
  3. mouse click coords and moving a rect
    By techrolla in forum Windows Programming
    Replies: 1
    Last Post: 03-07-2004, 09:49 PM
  4. Moving a Static box with the mouse
    By AtomRiot in forum Windows Programming
    Replies: 4
    Last Post: 06-26-2003, 11:34 PM
  5. Moving Mouse Pointer
    By loobian in forum Windows Programming
    Replies: 8
    Last Post: 10-16-2001, 03:45 PM