Hello All,
I am calling one of the exe with the help of shell command as follows
ProcessId = Shell(ProgramNa me, Window)
hProcess = OpenProcess(PRO CESS_QUERY_INFO RMATION, False, ProcessId)
Do
Call GetExitCodeProc ess(hProcess, exitCode)
DoEvents
Loop While exitCode = STATUS_PENDING
Call CloseHandle(hPr ocess)
In some cases I want to terminate exe and come out from it. For that I am using code like below,
Call PostMessage(hPr ocess, WM_CLOSE, 0&, 0&)
Call PostMessage(hPr ocess, WM_DESTROY, 0&, 0&)
Call PostMessage(hPr ocess, WM_NCDESTROY, 0&, 0&)
TerminateProces s hProcess, 0&
But then also it is not able to terminate exe. ProcessId and hProcess stuff is ok. What can be the reason?
I am calling one of the exe with the help of shell command as follows
ProcessId = Shell(ProgramNa me, Window)
hProcess = OpenProcess(PRO CESS_QUERY_INFO RMATION, False, ProcessId)
Do
Call GetExitCodeProc ess(hProcess, exitCode)
DoEvents
Loop While exitCode = STATUS_PENDING
Call CloseHandle(hPr ocess)
In some cases I want to terminate exe and come out from it. For that I am using code like below,
Call PostMessage(hPr ocess, WM_CLOSE, 0&, 0&)
Call PostMessage(hPr ocess, WM_DESTROY, 0&, 0&)
Call PostMessage(hPr ocess, WM_NCDESTROY, 0&, 0&)
TerminateProces s hProcess, 0&
But then also it is not able to terminate exe. ProcessId and hProcess stuff is ok. What can be the reason?
Comment