sebastiannielsen
Programmer
I always get the error PInvokeStackImbalance when im trying to call OpenProcess in my VB 2005 application
I have declared Openprocess as following:
Private Declare Function OpenProcess lib "kernel32.dll" (ByVal dwDesiredAccess as long, ByVal bInheritHandle as boolean, ByVal dwProcessId as long) as long
Im using it in this way:
(ExitPid is a "long" return value from the Shell function earlier in the program)
dim hh as long
hh = OpenProcess(1, false, ExitPid)
TerminateProcess(hh, 0)
CloseHandle(hh)
I have declared Openprocess as following:
Private Declare Function OpenProcess lib "kernel32.dll" (ByVal dwDesiredAccess as long, ByVal bInheritHandle as boolean, ByVal dwProcessId as long) as long
Im using it in this way:
(ExitPid is a "long" return value from the Shell function earlier in the program)
dim hh as long
hh = OpenProcess(1, false, ExitPid)
TerminateProcess(hh, 0)
CloseHandle(hh)