Kbase 17142: How to Call WIN32 API Function: GetAtomName
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
How to Call WIN32 API Function: GetAtomName
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 GetAtomName. This function copies the atom name that is
stored for the given atom into the provided buffer.
This code has been tested on Windows NT 4.0 Workstation only.
DEFINE VARIABLE chrAtomString AS CHARACTER NO-UNDO FORMAT "X(256)".
DEFINE VARIABLE intAtom AS INTEGER NO-UNDO.
DEFINE VARIABLE intResult AS INTEGER NO-UNDO.
PROCEDURE GetAtomNameA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER intAtom AS SHORT.
DEFINE OUTPUT PARAMETER chrAtomString AS CHARACTER.
DEFINE INPUT PARAMETER intBufferSize AS LONG.
DEFINE RETURN PARAMETER intResult AS SHORT.
END PROCEDURE.
ASSIGN chrAtomString = FILL(" ", 256).
RUN GetAtomNameA (INPUT intAtom,
OUTPUT chrAtomString,
INPUT 255,
OUTPUT intResult).
IF intAtom <> 0 THEN
MESSAGE chrAtomString VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Function call failed, not sure why" VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17142