PDA

View Full Version : Another QProcess Question



kosasker
9th July 2012, 10:28
Hi all. I have a slot that, runs an external windows application like this.



//Header

QProcess *runEx;




//In class constructor
...
runEx = new QProcess(this);
...

//Process starter slot

void procTests::runCustomWin()
{
runEx->start("test.exe");
runEx->waitForStarted();
}

//Slot for terminate

void procTests::stopCustomWin()
{
runEx->terminate();
}

//Deconstructor

procTests::~procTests()
{
delete runEx;
}


"test.exe" has a message dialog. When I send a signal for closing(QProcess terminate), popup works and ask user for really wants exit the application, or not.
For exit application, user must answer that. I want to automate this process, but i cant figured it out ?
How can I close this popup immediatelly with legal way (without force kill) and terminate process ?

Best regards.

kosasker
13th July 2012, 07:42
Hi all. I find a solution here http://stackoverflow.com/questions/1195210/c-sharp-close-openvpn-cleanly.
Which class in Qt can do this EventWaitHandle (http://msdn.microsoft.com/en-us/library/system.threading.eventwaithandle.aspx#Y114) .Net class's work? Or which windows dev library? How can I handle another thread with Qt, in windows like this?
If you have an idea, please share with me. I didnt want a code line. Just can't find the solution.

Best regards.

kosasker
16th July 2012, 12:03
[SOLVED]

Best Regards