petrojelly 0 Posted April 13, 2005 Hello, i am trying to get a process handle by using the OpenProcess API, but it is always equal to 260 regardless of the different process ID that i use. Is there something wrong with this code ? $PROCESS_ALL_ACCESS = 0x1F0FFF $PID = ProcessExists("Icq.exe") $PHandle = DllCall("Kernel32.dll", "long", "OpenProcess", "int", PROCESS_ALL_ACCESS, "int", 0, "int", $PID) can someone tell me why $PHandle[0] is always equal to 260 ? Share this post Link to post Share on other sites
bshoenhair 0 Posted April 13, 2005 Hello, i am trying to get a process handle by using the OpenProcess API, but it is always equal to 260 regardless of the different process ID that i use. Is there something wrong with this code ? $PROCESS_ALL_ACCESS = 0x1F0FFF $PID = ProcessExists("Icq.exe") $PHandle = DllCall("Kernel32.dll", "long", "OpenProcess", "int", PROCESS_ALL_ACCESS, "int", 0, "int", $PID)can someone tell me why $PHandle[0] is always equal to 260 ?<{POST_SNAPBACK}>Maybe a typo with PROCESS_ALL_ACCESS in DLLCALL shouldn't it be $PROCESS_ALL_ACCESS ?$PHandle = DllCall("Kernel32.dll", "long", "OpenProcess", "int", $PROCESS_ALL_ACCESS, "int", 0, "int", $PID) Share this post Link to post Share on other sites
petrojelly 0 Posted April 13, 2005 Thx Larry you were right. The PHandle doesnt have to be different for different pID, it just have to be unique. To bshoenhair, thanks for pointing that out, it's a typo i made in the post. Share this post Link to post Share on other sites