Consultor Eletrônico



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

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 GlobalFindAtom. This function performs a case-insensitive
search of the global atom table for a match of a given string.
Because generally atoms (and not strings) are exchanged between
applications, this function is not often used.

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


DEFINE VARIABLE intAtom AS INTEGER NO-UNDO.

PROCEDURE GlobalFindAtomA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrAtom AS CHARACTER.
DEFINE RETURN PARAMETER intAtom AS SHORT.
END PROCEDURE.

RUN GlobalFindAtomA (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 # 17146