Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
Configuring DEVMODE structure for a printer
Obtaining OS memory performance information
Opening access to the Microsoft Internet functions for the application
Removing FTP directory
Using InternetGoOnline function
Using the GetTempFileName
How to find which fonts Windows uses for drawing captions, menus and message boxes
Semi-transparent Form
Using FtpCommand
Winsock: how to retrieve the protocol information corresponding to a protocol name
Determining if an Active Network Connection is Available
Enumerating files opened on the network
Extracting the name and extension parts of a path string
Reading and setting explicit Application User Model ID for the current process (Win7)
Smart Card Database Query Functions
Using an Event Object. Part B: running an application responding to events
Wininet last error description
Winsock: retrieving information about available transport protocols
Changing system colors
Memory usage info for current VFP session (WinNT only)
Reading metrics for the currently selected font
Retrieving the names of all sections in an initialization file
Scanning a hierarchy of child windows down from the Windows Desktop
Retrieving list of Global Atom names

User rating: 10/10 (1 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
#DEFINE MAX_ATOM_LENGTH 250
 
DECLARE INTEGER GlobalGetAtomName IN kernel32;
    INTEGER nAtom,;
    STRING @lpBuffer,;
    INTEGER nSize
 
CREATE CURSOR cs (atom N(12), atomname C(MAX_ATOM_LENGTH))
 
* scanning the string atoms
FOR nAtom = 0xC000 TO 0xFFFF
    lpBuffer = REPLICATE(CHR(0), MAX_ATOM_LENGTH)
 
    lnResult = GlobalGetAtomName(;
                    nAtom,;
                    @lpBuffer,;
                    MAX_ATOM_LENGTH)
 
    IF lnResult > 0
        INSERT INTO cs;
        VALUES (nAtom, LEFT(lpBuffer, lnResult))
    ENDIF
ENDFOR
 
SELECT cs
GO TOP
BROWSE NORMAL NOWAIT
 

User rating: 10/10 (1 votes)
Rate this code sample:
  • ~
586 bytes  
Created: 2001-08-23 12:00:00  
Modified: 2012-10-20 18:05:25  
Visits in 7 days: 82  
Listed functions:
GlobalGetAtomName
Printer friendly API declarations
My comment:
Not too many applications for the Atoms I could come with. Direct DDE programming with atoms hardly fascinates any VFP programmer :)

Atoms can be used in a way similar to public variables for saving different states of the application. Atom name stays in the local atom table until the application terminates.

If you want to prevent users starting application B prior to starting application A, make the A to create a global atom that can be used by application B as a confirmation that application A has started.

Knowing atoms created by specific applications, one may guess about those applications. For example, atom "FireFox" appears and stays in the global table when the FireFox browser starts. By itself, this knowledge is rather useless. In certain circumstances, who knows, it can make a difference.

* * *
The names of all registered window classes are kept in an atom table internal to USER32. The value returned by the RegisterClass function is that atom. You can also retrieve the atom for a window class by asking a window of that class for its class atom via GetClassWord(hwnd, GCW_ATOM).

* * *
Read article What"s the atom returned by RegisterClass useful for? on The OldNew Thing blog.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (107.21.186.38)
3 sec.Function: 'gethostbyaddr'
Function group: 'Windows Sockets 2 (Winsock)'
6 sec.Function: 'OpenInputDesktop'
2.76 hrs.Function: 'GdipRotateWorldTransform'
Function group: 'GDI+ Graphics'
4.28 hrs.Function: 'PathCompactPathEx'
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
8.13 hrs.Function: 'GetNamedSecurityInfo'
Function group: 'Security'
 Example: 'How to draw custom Window Caption on FoxPro form'
8.45 hrs.Example: 'Adding and deleting User Accounts'
 Example: 'Converting a decimal string to an integer'
 Function: 'MAPISendDocuments'
13.59 hrs.Example: 'Pocket PC: creating new database in the Object Store and copying Contacts Database records into it'
Google
Advertise here!