petrojelly Posted April 13, 2005 Share 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 ? Link to comment Share on other sites More sharing options...
bshoenhair Posted April 13, 2005 Share 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) Link to comment Share on other sites More sharing options...
petrojelly Posted April 13, 2005 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now