Martin Hinner's

api commander

Win32 GUI "scripting" tool

[ Download exe ] [ Download source zip ] [ Feedback ]

I am a Unix guy. I am used to make shell scripts for everything I do frequently. Windows GUI appliacations usually lack any support for running from script (oh, cmd file :-) ). For this purpose I wrote api commander.

API commander allows you to invoke several Win32 API routines from a "batch" file. The supported API functions allow you to control windows and dialogs (e.g. you can enter something into edit box and then press some action button, wait a couple of seconds for command completion and then close window).

Supported comands are (taken from apicmndr source code):

	{"quit", cmd_quit},
	{"verbose", cmd_verbose},
	{"UsehWnd", cmd_UsehWnd},
	{"EnumWindows", cmd_EnumWindows},
	{"EnumSubWindows", cmd_EnumSubWindows},
	{"EnumDialog", cmd_EnumDialog},
	{"WindowFromPoint", cmd_WindowFromPoint},
	{"FindWindow", cmd_FindWindow},
	{"FindWindowEx", cmd_FindWindowEx},
	{"MessageBox", cmd_MessageBox},
	{"SendMessage", cmd_SendMessage},
	{"GetDlgItem", cmd_GetDlgItem},
	{"SetWindowText", cmd_SetWindowText},
	{"Sleep", cmd_Sleep},
	{"System", cmd_System},
	{"CreateProcess", cmd_CreateProcess},
These commands usually have same arguments as respective Win32 api functions. Look at MSDN for more detailed description. Look also at example below to see how does it work. It would be lovely if someone can write documentation for this program. Anybody interested ?

The program allows you to prepare a batch file (I use '*.acmd' extension). If you supply name of the .acmd file when running the program, it will take all commands from this file. Otherwise the program runs in interactive mode.

I am willing to improve this program, but only on paid basis. If you need to extend functionality, mail me at hinner(at)secons(dot)com.

If you found this program useful, consider donating a few bucks!

Example use

In this example we will play a bit with standard MS Windows "Run as" dialog. Before you play with it you have to invoke this dialog by pressing Win+R.
Default "Run as" dialog

API commander screenshot

"Run as" dialog without "OK" button ;-)

See also