Declare Function OpenProcess Lib "Kernel32.dll" _ (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _ ByVal dwProcId As Long) As Long
В успешном случае возвращается открытый дескриптор процесса. В случае ошибки возвращается 0 (используйте GetLastError для получения кода ошибки)
PROCESS_ALL_ACCESS = &H1F0FFF | Полный доступ |
PROCESS_CREATE_PROCESS | Право на создание процесса |
PROCESS_CREATE_THREAD = &H2 | Право на создание нити |
PROCESS_DUP_HANDLE = &H40 | Enables using the process handle as either the source or target process in the DuplicateHandle function to duplicate a handle. |
PROCESS_QUERY_INFORMATION = &H400 | Enables using the process handle in the GetExitCodeProcess and GetPriorityClass functions to read information from the process object. |
PROCESS_SET_QUOTA | Enables using the process handle in the AssignProcessToJobObject and SetProcessWorkingSetSize functions to set memory limits. |
PROCESS_SET_INFORMATION = &H200 | Enables using the process handle in the SetPriorityClass function to set the priority class of the process. |
PROCESS_TERMINATE = &H1 | Enables using the process handle in the TerminateProcess function to terminate the process. |
PROCESS_VM_OPERATION = &H8 | Enables using the process handle in the VirtualProtectEx and WriteProcessMemory functions to modify the virtual memory of the process. |
PROCESS_VM_READ = &H10 | Enables using the process handle in the ReadProcessMemory function to read from the virtual memory of the process. |
PROCESS_VM_WRITE = &H20 | Enables using the process handle in the WriteProcessMemory function to write to the virtual memory of the process. |
SYNCHRONIZE = &H100000 | Windows NT/2000 or later: Enables using the process handle in any of the wait functions to wait for the process to terminate. |
Смотри пример modlist.zip