Winapi: addatom, deleteatom, findatom, getatomname, globaladdatom, globaldeleteatom, globalfindatom, global

Source: Internet
Author: User
This is a set of APIS for storing strings.
Store a string through addatom and return an ID;
Getatomname uses this ID to return the stored string;
You can also use findatom to find and delete stored strings with deleteatom.

This storage area is divided into local (ProgramLevel) and Global (system level), with the global prefix is global [but in Win32 whether they are different yet to be studied].

The strings in the table are case-insensitive. If the names are repeated, an ID reference will be added, but the first string will be used.

 // Declaration: addatom (lpstring: pchar {string pointer}): atom; {return string ID} deleteatom (natom: Atom {string ID }): atom; {return string ID; Failure return 0} findatom (lpstring: pchar {string pointer}): atom; {return string ID; Failure return 0} getatomname (natom: atom; {string ID} lpbuffer: pchar; {buffer} nsize: INTEGER {buffer size}): uint; {returns the actual length of the string; returns 0 if a failure} globaladdatom (lpstring: pchar {string pointer}): atom; {returned string ID} globaldeleteatom (natom: Atom {string ID}): atom; {returned string ID; failed returned 0} globalfindatom (lpstring: pchar {string pointer}): atom; {returns string ID; returns 0 if a failure} globalgetatomname (natom: atom; {string ID} lpbuffer: pchar; {buffer} nsize: INTEGER {buffer size}): uint; {returns the actual length of the string; returns 0 if failed}

   // For example: var N1, N2: atom; PS: array [0 .. 254] of char; begin N1: = addatom ('delphi blog in case '); N2: = addatom ('delphi blog in case'); getatomname (N1, PS, 255); showmessage (PS); {in case of Delphi blog} getatomname (N2, PS, 255); showmessage (PS); {in case of Delphi blog} end;

   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.