Consultor Eletrônico



Kbase 17692: How to Call WIN32 API Function: GetCurrentProcessId
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How to Call WIN32 API Function: GetCurrentProcessId

DISCLAIMER:
===========
The code example in this knowledgebase is for informational purposes
only. If you have specific questions about which API calls would be
best suited to your design goals, please consult your Microsoft
documentation.

INTRODUCTION:
=============
The following sample code shows how to call the Win32 API function
called GetCurrentProcessId. This function returns the process ID of
the currently executing process. This is a unique identifier
throughout the system until the process has been closed.

This code has been tested on Windows NT 4.0 Workstation only.


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.

Progress Software Technical Support Note # 17692