Click to See Complete Forum and Search --> : program control api's required
haris-raheem
Aug 7th, 2001, 10:26 AM
i want to control the execution of a program like we do when using wizards , through mouse and keyboard.
can any one help me.
Megatron
Aug 7th, 2001, 02:12 PM
Your description is somwhat vague. Please be more specific in what you're trying to do.
If responding to keyboard and mouse events is all you want, put some code in the control's MouseDown, MouseMove, MouseUp, Click, DblClick, KeyUp, KeyDown, KeyAscii etc. events.
haris-raheem
Aug 8th, 2001, 06:29 PM
the description is that when you execute a program you interact
with it by clicking the controls or entering text.
i want to be capable of controling this program from another program apart from this and then through api calls navigate it
by producing click and other events and do as a user do or in other words provide a simulation of a user.
thanks
haris rahim
Megatron
Aug 9th, 2001, 07:53 AM
You can interact with it by using the following messages and functions. First off, use FindWindowEx to get the handle of the parent and child windows. Once you have the handle, you can being controlling the App. For button clicks, send the BM_CLICK message. For mouse clicks, you need to use the PostMessage() (not SendMessage) and set the WM_LBUTTONDOWN then WM_LBUTTONUP message. Likewise, send WM_KEYDOWN and WM_KEYUP for keyboard messages. The WM_MOUSEMOVE (for memory) or SetCursor (for display) message/function can be used to move the mouse. The mouse_event can also be used to move/press the mouse. Likewise the keybd_event() function can be used to work with the keyboard. Lastly, to set the text of a control (e.g: an edit control) send the WM_SETTEXT message.
There are probably many other ones out there as well.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.