If you have a pid and want to see if the pid is a valid process
Code:
Private Declare Function GetPriorityClass Lib "kernel32" (ByVal hProcess As Long) As Long
if GetPriorityClass(hProcess) > 0 then
' process exists
else
' process does not exist
end if