Results 1 to 6 of 6

Thread: Move Click

  1. #1

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Move Click

    hi friends
    I have in my pocket how to use SetCursorPos & Mouse EVENT API usage.
    But i want Mouse Click on given coordinates... Without moving Cursor
    Means i can use Mouse Event API to generate Click
    But cursor should stay where it is But click should be generated..
    Lets take an example

    Mouse Cursor is on Coordinates ( 100,100)
    but i want to click at Coordinates (200,200) but cursor should keep on displaying at (100,100)

    ** i think it made sense
    Thx in Advance

  2. #2

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: Move Click

    If you are unsure about my question ....
    ask me ....
    i m here..

  3. #3
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: Move Click

    You might try saving the cursor position before the move and click code.
    Then move it back immediatly.

    There's a chance that the move would be too fast to be seen.

  4. #4

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Re: Move Click

    Quote Originally Posted by longwolf
    You might try saving the cursor position before the move and click code.
    Then move it back immediatly.

    There's a chance that the move would be too fast to be seen.
    Ah..
    I dont want to mess with Cursor Position...

  5. #5
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Move Click

    no, i think thats the only way to do it. you wont even see it..

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Move Click

    The only other way I can think of is to get the handle of the window or control at the position you want to click, you could use the WindowFromPoint API for that. Then send the WM_LBUTTONDOWN and WM_LBUTTONUP to that handle.

    EDIT: BTW attached is a nice class I wrote that wraps the mouse_event and GetCursorPos. It's easy to use and you can specify point on the screen in pixels instead of absolute mouse coordinates. This could make it easy for you to move, click and the move back if you don't want to use the above mentioned approach.
    Attached Files Attached Files
    Last edited by Joacim Andersson; May 12th, 2005 at 05:25 PM.

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