Solved

check another app is stoping or running in main app?

Posted on 2006-11-29
4
180 Views
Last Modified: 2010-04-01
Hi expert, i have question, can help you?

My main app call another app (app2) with parameters to do a thing.

Calling by ShellExcute,
Example:
....
ShellExcute(NULL, _T("Open"), app2 ,param list, NULL, SW_SHOW)
//check whether app2 stop or not
//if stop will do next steps else wait for complete....
.....
Now, i would like to know (by coding) when app2 will end, so that  i can go to next step for the main app

Can anyone show me code how to do. I need this as soon as posible

Thank you
0
Comment
Question by:CongUan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
ambience earned 150 total points
ID: 18043164
Use ShellExecuteEx

SHELLEXECUTEINFO sei;
ZeroMemory(&sei,sizeof(sei));
sei.cbSize = sizeof(sei);
sei.lpFile = app;
sei.lpVerb = _T("Open");
sei.lpParameters = param_list;
sei.nShow = SW_SHOW
sei.fMask  = SEE_MASK_NOCLOSEPROCESS;
ShellExecuteEx(&sei);

WaitForSingleObject(sei.hProcess);  // wait for process to terminate/close
0
 
LVL 22

Expert Comment

by:ambience
ID: 18043167
Ops that has to be

WaitForSingleObject(sei.hProcess, INFINITE);  // wait for process to terminate/close
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question