-
February 12th, 2012, 12:51 AM
#1
Move Mouse
Hello!
How can I move the mouse to different locations in another application. Currently, I used HDC and HWND to get my window's handle. (Also FindWindow). So, is it possible to like MouseMove(HDC, 5,5)?
-
February 12th, 2012, 03:48 AM
#2
Re: Move Mouse
have a search for these apis:
GetCursorPos Lib "User32.dll"
SetCursorPos Lib "User32.dll"
mouse_event Lib "user32
GetAsyncKeyState Lib "user32"
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
February 12th, 2012, 02:07 PM
#3
Re: Move Mouse
BY the way, you could find this interesting: a hook for windows and exactly for the mouse:
http://support.microsoft.com/kb/319524
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
February 17th, 2012, 01:30 PM
#4
Re: Move Mouse
thanks for the info. can you or someone post an example on how to use the above api with a hwnd/hdc.
here is my current code:
Code:
Dim hWnd As Integer = FindWindow(vbNullString, "Untitled - Notepad")
Dim hDC As IntPtr
SetForegroundWindow(hWnd)
hDC = GetDC(hWnd)
'I would like to move the mouse here. MouseMove(HDC/HWND,X,Y)
It looks possible lol. thanks for all the help!
-
February 18th, 2012, 03:47 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|