Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21201

TerminateProcess

$
0
0
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.

Viewing all articles
Browse latest Browse all 21201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>