how would you make the mouse move to a certain place into an active x control, then click, then type something?
Printable View
how would you make the mouse move to a certain place into an active x control, then click, then type something?
To move the mouse you can use the SetCursorPos API.
To get the position of the control I guess you'll need the get it's handle with the FindWindow and FindWindowEx APIs.
Then to click you can use the mouse_event API.
Then to type just SendKeys should work, but since I've mentioned so many APIs, the keyb_event API can work also :D
i don't really get it, what's an API?
An API (Application Programming Interface) is a sub or a function that you can obtain through almost any DLL file, and allows you to do more in VB than ordinary VB code is capable of, or if it does, the API does it way faster and more efficient. Like for example:
VB Code:
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal Milliseconds As Long) Private Sub Form_Load() Sleep 5000 'After 5 seconds, your form should load End Sub
Here's what it does. The Sleep API causes your program to halt a certain number of milliseconds. And this sub is obtained from the Kernel32.dll file located in your Windows/System directory (System32 if you are using Windows 2000/XP).
You can find many more API's in here
http://www.mentalis.org/apilist/apilist.php
What's good about DLL files (when not an ActiveX dll) is that it can be created in any language and be used in any language. Like those dll files located in the System/System32 directory have been created in C or C++ yet can be used in VB.
thnx, now i understand what API is, but what do u type to do those digfferent API's?
That's what this was for:
http://www.mentalis.org/apilist/apilist.php
find api guide and api viewer
from www.allapi.net
pete
oh, i c, thnx guys