Close & Terminate the process Started by ShellExecuteEx()
-
How to Close the process /.exe started by ShellExecuteEx() function ? ->The SHELLEXECUTEINFO structure contains information used by the ShellExecuteEx function. ->hProcess Member of SHELLEXECUTEINFO structure : Handle to the newly started application. This member is set on return. Any help would be greatly appreciated! thanks in advance Cyber G india Pvt ltd.
priyank
-
How to Close the process /.exe started by ShellExecuteEx() function ? ->The SHELLEXECUTEINFO structure contains information used by the ShellExecuteEx function. ->hProcess Member of SHELLEXECUTEINFO structure : Handle to the newly started application. This member is set on return. Any help would be greatly appreciated! thanks in advance Cyber G india Pvt ltd.
priyank
This example should help you,
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); **ShExecInfo.fMask = SEE\_MASK\_NOCLOSEPROCESS;** ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb = NULL; ShExecInfo.lpFile = /\*FILE NAME\*/; ShExecInfo.lpParameters = NULL; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW\_MAXIMIZE; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); ASSERT(ShExecInfo.hProcess); //after use CloseHandle(ShExecInfo.hProcess );
Prasad Notifier using ATL | Operator new[],delete[][^]
-
This example should help you,
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); **ShExecInfo.fMask = SEE\_MASK\_NOCLOSEPROCESS;** ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb = NULL; ShExecInfo.lpFile = /\*FILE NAME\*/; ShExecInfo.lpParameters = NULL; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW\_MAXIMIZE; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); ASSERT(ShExecInfo.hProcess); //after use CloseHandle(ShExecInfo.hProcess );
Prasad Notifier using ATL | Operator new[],delete[][^]
thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.
priyank
-
thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.
priyank
pri_skit wrote:
when i press on Exit Button of my main application, then launched application's Window Should also shut down.
:). That you need to handle in your applicatin.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
pri_skit wrote:
when i press on Exit Button of my main application, then launched application's Window Should also shut down.
:). That you need to handle in your applicatin.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
pri_skit wrote:
Again thanks for your help.
TerminateProcess
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta Global Interface Table: An Easy Way to Marshal an Interface Pointer[new] VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.
priyank
pri_skit wrote:
thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.
Enumerate processes[^] and kill the process before exiting from application :) . Knock out 't' from can't, You can if you think you can :cool: