Kbase P6250: How to get the pid of the current Progress process on Windows ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/13/2005 |
|
Status: Verified
GOAL:
How to get the pid of the current Progress process on Windows ?
GOAL:
What is the process PID of my Progress session ?
GOAL:
What is the Windows API to get the current process ID ?
FACT(s) (Environment):
Windows NT 32 Intel/Windows 2000
FIX:
The Win32 API function called GetCurrentProcessId returns the process ID of
the currently executing process. This is a unique identifier throughout the system until the process has been closed.
Example:
DEFINE VARIABLE intProcessHandle AS INTEGER NO-UNDO.
PROCEDURE GetCurrentProcessId EXTERNAL "KERNEL32.DLL":
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
END PROCEDURE.
RUN GetCurrentProcessId (OUTPUT intProcessHandle).
MESSAGE "Process ID = " intProcessHandle VIEW-AS ALERT-BOX.