Get the handle of other processes from the process

xiaoxiao2021-03-06  42

The function is defined, I didn't add it, I found it! Dim uSnapShot As Long 'system snapshot return value Dim uResult As Long' iterate the process returns values ​​Dim uProcess As PROCESSENTRY32 'process definition structure variables Dim meHandle As Long' process handle uSnapShot = CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0 &) 'to establish a system snapshot uProcess.dwSize = len (uProcess) 'initialization process information length If uSnapShot Then uResult = Process32First (uSnapShot, uProcess)' to obtain a first process Do While uResult If InStr (Left (uProcess.szexeFile, InStr (uProcess.szexeFile, Chr (0)) - 1), "QQ.EXE")> 0 Then mehandle = openprocess (process_all_access, true, uprocess.th32processid) 'mehandle is the QQ handle end if uresult = process32next (usnapshot, uprocess)' gets the snapshot Next process LoopEND IF

转载请注明原文地址:https://www.9cbs.com/read-58934.html

New Post(0)