I'm looking for a simpe way to terminate a VB6 App from another VB6 App.
I successfully found the handle of the app using "FindWindow".
Used that handle in "TerminateProcess"; nothing happened the app did not terminate.
"TerminateProcess" returns "0".
Not sure what the parameter "lpExitCode" should be; I saw an example that set it to "0", but that didn't work.
Here's the simple code:
Sub main
processHandle = FindWindow("ThunderRT6FormDC", "MyApp")
MsgBox "processHandle: " & Hex(processHandle)
ExitCode = 0
TP_Return = TerminateProcess(processHandle, ExitCode)
MsgBox "TP_Return: " & Hex(TP_Return)
End Sub
Anyone have any Ideas?
Thanks, X.
I successfully found the handle of the app using "FindWindow".
Used that handle in "TerminateProcess"; nothing happened the app did not terminate.
"TerminateProcess" returns "0".
Not sure what the parameter "lpExitCode" should be; I saw an example that set it to "0", but that didn't work.
Here's the simple code:
Sub main
processHandle = FindWindow("ThunderRT6FormDC", "MyApp")
MsgBox "processHandle: " & Hex(processHandle)
ExitCode = 0
TP_Return = TerminateProcess(processHandle, ExitCode)
MsgBox "TP_Return: " & Hex(TP_Return)
End Sub
Anyone have any Ideas?
Thanks, X.