Public myHandle As LongFunction InitProcessCheater(pid As Long)pHandle = OpenProcess(&H1F0FFF, False, pid)If (pHandle = 0) Then
    InitProcessCheater = False
    myHandle = 0
Else
    InitProcessCheater = True
    myHandle = pHandle
End IfEnd Function

解决方案 »

  1.   

    Hi there!ok, if you want to know how to receive the values, then read the text ;-D :first you use the "CreateToolHelp32Snapshot" Api !
    when calling the Api you have to specifie what should be snaped
    (Processes,Thread,Heap) and you will receive a handle to these snapshot!
    with these handle you can call "Process32First" and "Process32Next" or
    "Thread32First" and "Thread32Next" or "Heap32First" and "Heap32Next" or
    "Module32First" and "Module32Next"! every of the listed apis has a pointer
    to a struct as parameter! when the call was sucessfull the struct was filled
    with all the informations you wanted ! to get the handle to a running
    process ( to kill this process ;) ) you call "OpenProcess" with a PID and
    you receive the handle connected with this PID !ok, i hope this will help you a bit !
    if you have more questions the please mail me !!!!best regards,
      

  2.   

    谢谢楼上两为,你们的思路我都理解,我正是用bob008(冻冬) 所说的方法取得的PID,但是在调用OPENPROCESS时返回的始终是0,百思不解,还望各位高手指点。
      

  3.   


    phnd = OpenProcess(&H10000, False, pid)pid 为你获取的进程id
    phnd为这个进程句柄