Hi. I need program wich will start other program (for example notepad.exe) and if notepad.exe will exit my program will start it again. How can i get info about process state and put it into variable to use with if? I'm beginner at C++ so please write all headers witch i need to include and code example with explanation. Thank you.

Hi. I need program wich will start other program (for example notepad.exe) and if notepad.exe will exit my program will start it again. How can i get info about process state and put it into variable to use with if? I'm beginner at C++ so please write all headers witch i need to include and code example with explanation. Thank you.

i don't know how to check if notepad is open...

but to open notepad:

system ("start notepad.exe");

is this..

I'm using this:

WinExec("C:\\WINDOWS\\notepad.exe", SW_SHOWNORMAL);

Anyway thanks for answer

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.