Consultor Eletrônico



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

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 GlobalAddAtom. This function stores a given string in the
system-wide global atom table. An atom name stored in the global
atom table may be returned by any application using the same atom
handle. Thus, an application can pass a string to another application
by sending a message and passing the atom as a parameter. The
receiver of the message can retrieve the associated string by calling
GlobalGetAtomName().

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


DEFINE VARIABLE intAtom AS INTEGER NO-UNDO.

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

RUN GlobalAddAtomA (INPUT "A FUN ATOM", OUTPUT intAtom).

MESSAGE intAtom VIEW-AS ALERT-BOX.

Progress Software Technical Support Note # 17144