How to know that application is closed. that was launched by ShellExecute()
-
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage? Thanks Regards.
-
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage? Thanks Regards.
-
First of all what type of application you are creating. Here you can chect the value of handle.... check if it exist... Cheers "Peace of mind through Technology"
-
Does it means that If when 2nd application is closed then the handle returned by ShellExecute will automaticlay become flase or expired or null. Regards.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shellexecute.asp[^] Here, in the "Return Value" section, it says: The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however this is this.
-
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage? Thanks Regards.
zahid_ash wrote:
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage?
You may keep track of process by enumrating the running processes in specific time stamp. Knock out 't' from can't, You can if you think you can :cool:
-
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage? Thanks Regards.
-
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage? Thanks Regards.
In order to see that a process was closed, you need its "handle". Please compare
ShellExecuteEx
andCreateProcess
in order to see which is more suitable to obtain the handle. Then use the handle in the following mode:if(::WaitForSingleObject(handle, 0) == WAIT_OBJECT_0) { // the process is closed } else { // the process is running, or an error }
If you want to wait until the process is closed, then specify a timeout value in
WaitForSingleObject
. See this function for more details. -
if u r application happens to be an .exe then u can get Processid.Using it u can track application B in Application A.This might help u.:(( never say die
-
Hi, I have lauchned an application B from my application A using ShellExecute() , it will return a Handle. How can I track in application A that application B is closed at certain stage? Thanks Regards.
Use SHELLEXECUTEINFO with ShellExecuteEx() and the structure has a member "hProcess" this is the handle to newly created process.
suhredayan
There is no place like 127.0.0.1