Opening and Manipulating Other Programs

I know I can open other programs with something like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <windows.h>

int main()
{
StartProgram("C:\\Program Files (x86)\Microsoft Office\Office14\WINWORD.exe");
system("pause");
return 0;
}
 void OpenProgram(string FileName)
{
ShellExecute(NULL,"open",FileName.c_str(),NULL,NULL,SW_SHOWNORMAL);
}


My question is, can I manipulate other programs? I used Word in this example, but I ask really because there are many other programs I use that I would like to create something like a macro to make life easier.
Last edited on
Macros are traditionally done from the keyboard through an input filter of some kind, not from some encapsulating parent process. To answer your question though, you can "manipulate" any program that provides an API allowing you to do so and a great many of them do. Without an API though this becomes impractical.
Thanks @Computergeek01

The API would be proprietary. I wanted to manipulate a program that belongs to my company to make programming much easier and quicker. For example, for every 2 Limit Switches, Open and Close feedback, create the logic for the Mismatch Alarms. I mean it's going to be the same all the time, and the coding is frequent enough for it to be useful. It would probably lessen copy/paste errors as well. We currently have something similar, but only the Development Team has it and everyone else is only allowed to use it when the client pays for it.
Topic archived. No new replies allowed.