Kbase 17139: How to Call WIN32 API Function: AddAtom
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Call WIN32 API Function: AddAtom
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 AddAtom. This function stores a given string in the local atom
table of an application. If an atom name that matches the string is
already stored in the local atom table, AddAtom() increments the
reference count of the corresponding atom. No duplicate atom names
are ever stored in an atom table, including atom names that vary only
is case.
The code has been tested on Windows NT 4.0 Workstation only.
DEFINE VARIABLE intAtom AS INTEGER NO-UNDO.
PROCEDURE AddAtomA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrStringToStore AS CHARACTER.
DEFINE RETURN PARAMETER intAtom AS SHORT.
END PROCEDURE.
RUN AddAtomA (INPUT "A FUN ATOM", OUTPUT intAtom).
MESSAGE intAtom VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17139