So I'm fairly new to C++ and I'm wondering if this would be possible and what the code would look like.

I'm trying to create an ongoing process that monitors when a certain program does something and launches another program when that thing happens.

Example:

I have Steam open and begin downloading a game, my mystery process sees this download start and executes a command to open another program.

Is this possible? I'm just curious and, with a little help, would like to write something like this for personal use (and learning). Sorry for the noobish-ness

Thanks!

Maybe a Windows API call (like a process alert thing?) i'm not a windows guy, so i wouldn't know, but that's my guess

Yes it is possible. You have to work with your OS api.

And it is easy, in Linux just observe running processes and conditionally create a new thread and use execv() to run a specific program.

Interesting, thanks for the replies. I'm definitely looking into APIs (using Windows atm), hopefully it's as easy a task on other OSes as it is on Linux!

Looking for running processes won't help with that problem because it doesn't tell you what the processes are doing. Launching other programs is the easy part, just a win32 api function call. Watching what other processes are doing will be a lot more complicated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.