|
-
May 27th, 2000, 12:23 AM
#1
Thread Starter
Member
(*sorry about my enlish, i am from Israel*)
Hi
I wanna ask few very important questions.
1. How can i move the MOUSE (with API call/s..without moving the mouse..) I wanna move the mouse all over the screen . not only at a VB form...
2. Is it possibe to make a Click event of the mouse (that moves all oven the screen).
Is it possible? any info will be great. I will very happy to get an examples
Thanks!
Nimrod/Namo
Israel
-
May 27th, 2000, 01:18 AM
#2
Shalom Namo!
To move the mouse:
Put this in a module:
Code:
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Form Code:
Code:
Dim t&
t& = SetCursorPos(0, 0) 'set it to any point
It is possible to make the mouse click wherever it goes...but I don't know the code to that :P.
[Edited by Matthew Gates on 05-27-2000 at 02:24 PM]
-
May 27th, 2000, 02:14 AM
#3
Frenzied Member
when you say make a click event do you maen detect a mouse click or send a mouseclick to a window?
-
May 27th, 2000, 04:29 AM
#4
Thread Starter
Member
Matthew Gates - Thank you very much!! (toda)
Sam Finch -
I mean send a mouse click to a window.
I want it to fire the "click event" that will work for all the screen.. not just on the form for example...
(if it will be "clicked" on a icon of shortcut . then it will work..)
Thnaks
Nimrod/Namo
-
May 27th, 2000, 09:30 AM
#5
Here you go, I found a way to make the mouse click:
Code:
Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Call mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&)
Hope that helps.
-
May 28th, 2000, 05:39 AM
#6
Thread Starter
Member
Thanks Again! and again and again and again.....
-
May 28th, 2000, 06:09 AM
#7
Thread Starter
Member
Hmm - Gats.. Something not working for me. the API call works fine.. (no errors or something) but when i "fire" the mouse left click event nothing happen..
For example. if i put the mouse over a Link to http://www.nba.com (on IE) and then i fire the evet with the api call.. then it is NOT going to nba.com ... i want it wt work like a real user clicked on it.
You understand what i mean? any idea whats the problem or how to do it?
Namo.
-
May 28th, 2000, 06:16 AM
#8
Thread Starter
Member
Ok ok. i konw how to use it.. if you wanna do it you need to 2 API functions.. (for 1 real click)
Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&)
Call mouse_event(MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&)
Unless it wont work 
Ok.
have a nice day
Nimrod/Namo
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
|