Kbase 17141: How to Call WIN32 API Function: FindAtom
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Call WIN32 API Function: FindAtom
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 FindAtom. This function performs a case-insensitive search of
the local atom table for an atom name that matches a given string.
This code has been tested on Windows NT 4.0 Workstation only.
DEFINE VARIABLE intAtom AS INTEGER NO-UNDO.
PROCEDURE FindAtomA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrAtom AS CHARACTER.
DEFINE RETURN PARAMETER intAtom AS SHORT.
END PROCEDURE.
RUN FindAtomA (INPUT "A FUN ATOM", OUTPUT intAtom).
IF intAtom <> 0 THEN
MESSAGE "Atom was found, ID=" + STRING(intAtom) VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Atom name does not exist" VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17141