Programatic interface to GUI application 
Author Message
 Programatic interface to GUI application

Hi,

I'm looking for a broad answer to this question:  Given a handle to a
GUI based (MFC) process, how can I programatically control this GUI
(MFC) based process from another process?  Which groups of API
functions should I look into?  For example, if I knew an application
has a button, how can I programatically click that button from another
process?

Thanks



Mon, 12 Sep 2005 07:28:26 GMT  
 Programatic interface to GUI application

Quote:

> Hi,

> I'm looking for a broad answer to this question:  Given a handle to a
> GUI based (MFC) process, how can I programatically control this GUI
> (MFC) based process from another process?  Which groups of API
> functions should I look into?  For example, if I knew an application
> has a button, how can I programatically click that button from another
> process?

> Thanks

Controlling another process via its GUI is not well supported. Many
things can be done, many can not. You need HWNDs for the process's
windows (FindWindow(Ex), EnumChildWindows).  You need resource IDs for
the process's controls (use Spy++ tool).  Then you can manipulate its
controls with SendMessage, simulating clicks and menu commands.  You can
read/write edit controls with SendMessage(WM_SETTEXT / WM_GETTEXT...).
Sending keystrokes (SendInput) doesn't work unless the process is in the
foreground.

--
Scott McPhillips [VC++ MVP]



Mon, 12 Sep 2005 13:01:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. GUI interface for C applications

2. Developing GUI interface application in Windows

3. Distinguishing User Interface events: user -vs- programatic

4. interface gui

5. GUI interface source

6. making a gui interface for my program in VC++, well c++

7. Utility with GUI and command line interface

8. convert MFC gui to a web interface

9. GUI Interface

10. Gui interface ...

11. making a gui interface for my program in VC++, well c++

12. Utility with GUI and command line interface

 

 
Powered by phpBB® Forum Software