Can someone tell me the parameters required by the Win32 API function
'OpenProcess'?
TIA
--
Stephen Theobald, Croydon, Surrey
ste...@softmail.demon.co.uk
http://www.softmail.demon.co.uk/
Forgive an obvious question, but why don't you just look it up in your
compiler's documentation?
Chris
----------------------------------------------------------------
Chris Marriott, SkyMap Software, U.K. e-mail: ch...@skymap.com
Creators of fine astronomy software for Windows.
For full details, visit our web site at http://www.skymap.com
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance flag
DWORD dwProcessId // process identifier
);
You can find info in online help, unless there's a reason you don't have
it available... Good luck.
Rob
Where can I get info on Win32 API functions from?
This is the description:
The OpenProcess function returns a handle of an existing process object.
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance flag
DWORD dwProcessId // process identifier
);
Parameters
dwDesiredAccess
Specifies the access to the process object. For operating systems that
support security checking, this access is checked against any security
descriptor for the target process. Any combination of the following
access flags can be specified in addition to the
STANDARD_RIGHTS_REQUIRED access flags:
Access Description
PROCESS_ALL_ACCESS Specifies all possible access flags for the process
object.
PROCESS_CREATE_PROCESS Used internally.
PROCESS_CREATE_THREAD Enables using the process handle in the
CreateRemoteThread function to create a thread in the process.
PROCESS_DUP_HANDLE Enables using the process handle as either the source
or target process in the DuplicateHandle function to duplicate a handle.
PROCESS_QUERY_INFORMATION Enables using the process handle in the
GetExitCodeProcess and GetPriorityClass functions to read information
from the process object.
PROCESS_SET_INFORMATION Enables using the process handle in the
SetPriorityClass function to set the priority class of the process.
PROCESS_TERMINATE Enables using the process handle in the
TerminateProcess function to terminate the process.
PROCESS_VM_OPERATION Enables using the process handle in the
VirtualProtectEx and WriteProcessMemory functions to modify the virtual
memory of the process.
PROCESS_VM_READ Enables using the process handle in the
ReadProcessMemory function to read from the virtual memory of the
process.
PROCESS_VM_WRITE Enables using the process handle in the
WriteProcessMemory function to write to the virtual memory of the
process.
SYNCHRONIZE Windows NT: Enables using the process handle in any of the
wait functions to wait for the process to terminate.
bInheritHandle
Specifies whether the returned handle can be inherited by a new process
created by the current process. If TRUE, the handle is inheritable.
dwProcessId
Specifies the process identifier of the process to open.
Return Values
If the function succeeds, the return value is an open handle of the
specified process.
If the function fails, the return value is NULL. To get extended error
information, call GetLastError.
Remarks
The handle returned by the OpenProcess function can be used in any
function that requires a handle to a process, provided the appropriate
access rights were requested.
See Also
CreateProcess, CreateRemoteThread, DuplicateHandle, GetCurrentProcess,
GetCurrentProcessId, GetExitCodeProcess, GetPriorityClass,
ReadProcessMemory, SetPriorityClass, TerminateProcess, VirtualProtectEx,
WriteProcessMemory,
Anyway, if you don't have it, I don't know where you can get
it. It's supplied with all of the C/C++ compilers and presumably
with Delphi as well. Maybe you have to buy a reference book
for the Win32 functions?
--
John A. Grant * I speak only for myself * jag...@nrcan.gc.ca
Airborne Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here.