"Kid" <Ki*@discussions.microsoft.comwrote in message
news:CC**********************************@microsof t.com...
Hi
How can I control other process UI and input some data value like input
edit
box or click button controls ?
Is there some good sample code and tool to help me ?
Thank you .
There is no all-purpose solution but many things can be done by sending
standard windows messages to HWNDs in the other process. First use the
Spy++ tool to find the IDs of the controls you are interested in. In your
program, find the HWNDs of these controls by using FindWindow and
EnumChildWindows. As you enumerate the child windows use GetClassName and
GetWindowLong with GWL_ID to recognize and store the child HWNDs you need.
You can input text to an edit control with SendMessage(... WM_SETTEXT...).
You can click controls by sending the same message to the parent dialog that
the control sends, such as WM_COMMAND with BN_CLICKED.
--
Scott McPhillips [VC++ MVP]