Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinINet)
Displaying bitmap using the AlphaBlend function
Splash Screen for the VFP application
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
Establishing connection using the SQLDriverConnect
How to put a vertical text scrolling on the form (a movie cast)
How to make a VFP form fading out when released (GDI+ version)
How to make a VFP form fading out when released (GDI version)
Using FlashWindowEx to flash the taskbar button of the VFP application
Winsock: sending email messages (SMTP, port 25)
How to create non-blocking Winsock server
Using WM_COPYDATA for interprocess communication (VFP9)
Creating a mailslot
Peer-to-peer LAN messenger built with Mailslot API functions
How to print a bitmap file
Class for sound recording
Sending a standard message with one or more attached files using default email client
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
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: 63  
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 (50.16.17.90)
3.73 hrs.Example: 'Displaying dimmed window behind VFP top-level form'
11.2 hrs.Function: 'gethostbyname'
Function group: 'Windows Sockets 2 (Winsock)'
Google
Advertise here!