Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieving IP statistics for the computer
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
How to view icons stored in executable files (Icon Viewer) - II
Playing WAV sounds simultaneously
Reading metrics for the currently selected font
Retrieving graphic capabilities of your display
URL: converting unsafe characters and spaces into escape sequences
FindText -- the hopeless and useless Common Dialog
How to find which fonts Windows uses for drawing captions, menus and message boxes
How to perform Base64 encoding/decoding using Cryptography API Functions
How to view system icons for the classes installed on the local machine
Obtaining a handle to the desktop associated with the calling thread
Using the IsWindowEnabled function
Creating a directory on the FTP
Enumerating print processors and supporting data types installed on the specified server
Enumerating the subkeys for a given registry key
How to build UDP responder
Printing text on the main VFP window
Removing FTP directory
Retrieving the command line for the VFP session
StrDup returns a pointer to the duplicate of a source VFP string
Using the CopyFile
Using the Semaphore object to allow only one instance of VFP application running
Customizing the frame of top-level form: removing the standard frame (VFP9, Vista)
Saving available locale records into a cursor

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
See also:
  • LanguageBar ActiveX control
  • Retrieving national language settings
  • Switching between keyboard layouts
  •  
    * some LOCALE constants
    #DEFINE LOCALE_ILANGUAGE                1   && language id
    #DEFINE LOCALE_SLANGUAGE                2   && localized name of language
    #DEFINE LOCALE_SENGLANGUAGE          4097   && English name of language
    #DEFINE LOCALE_SABBREVLANGNAME          3   && abbreviated language name
    #DEFINE LOCALE_SNATIVELANGNAME          4   && native name of language
    #DEFINE LOCALE_ICOUNTRY                 5   && country code
    #DEFINE LOCALE_SCOUNTRY                 6   && localized name of country
    #DEFINE LOCALE_SENGCOUNTRY           4098   && English name of country
    #DEFINE LOCALE_SABBREVCTRYNAME          7   && abbreviated country name
    #DEFINE LOCALE_SNATIVECTRYNAME          8   && native name of country
    #DEFINE LOCALE_IDEFAULTLANGUAGE         9   && default language id
    #DEFINE LOCALE_IDEFAULTCOUNTRY         10   && default country code
    #DEFINE LOCALE_IDEFAULTCODEPAGE        11   && default oem code page
    #DEFINE LOCALE_IDEFAULTANSICODEPAGE  4100   && default ansi code page
    #DEFINE LOCALE_IDEFAULTMACCODEPAGE   4113   && default mac code page
     
    #DEFINE LOCALE_ILDATE                  34   && long date format ordering
    #DEFINE LOCALE_ILZERO                  18   && leading zeros for decimal
    #DEFINE LOCALE_IMEASURE                13   && 0 = metric, 1 = US
    #DEFINE LOCALE_IMONLZERO               39   && leading zeros in month field
    #DEFINE LOCALE_INEGCURR                28   && negative currency mode
    #DEFINE LOCALE_INEGSEPBYSPACE          87   && mon sym sep by space from neg amt
    #DEFINE LOCALE_INEGSIGNPOSN            83   && negative sign position
     
    #DEFINE LOCALE_SDAYNAME1   0x0000002A
    #DEFINE LOCALE_SMONTHNAME1  0x00000038
    * there are at least 216 LOCALE constants
     
    DECLARE INTEGER GetLocaleInfo IN kernel32;
        INTEGER Locale, INTEGER LCType,;
        STRING @lpLCData, INTEGER cchData
     
    CREATE CURSOR cs (;
        locale    N(6),;
        langid    C( 4),;
        llnagname C(30),;
        elangname C(30),;
        alangname C( 3),;
        nlangname C(30),;
        ccode     C( 3),;
        lcname    C(30),;
        ecname    C(30),;
        acname    C( 3),;
        ncname    C(30),;
        dlangid   C( 4),;
        dccode    C( 3),;
        doemcp    C( 5),;
        dansicp   C( 5),;
        dmaccp    C( 5),;
        ldtfmt    C( 2),;
        ldzeros   C( 2),;
        metrics   C( 2),;
        monzero   C( 2),;
        necurr    C( 2),;
        negsep    C( 2),;
        negsign   C( 2),;
        sdayname1 C(10),;
        smonname1 C(20);
    )
     
    * scan top 0x10000 codes
    * under WinNT 4.0 it returns 138 records
    * WinMe -- 164 records
    FOR ii=0 TO 65535
        = SaveLInfo(ii)
    ENDFOR
     
    SELECT cs
    GO TOP
    BROWSE NORMAL NOWAIT
    * end of main
     
    PROCEDURE SaveLInfo(lnLocale)
    * saves one local record for the locale
        IF Len(GetLInfo(lnLocale, LOCALE_ILANGUAGE)) = 0
        * exit if no information exists for this locale id
            RETURN
        ENDIF
     
        INSERT INTO cs VALUES (;
            lnLocale,;
            GetLInfo(lnLocale, LOCALE_ILANGUAGE),;
            GetLInfo(lnLocale, LOCALE_SLANGUAGE),;
            GetLInfo(lnLocale, LOCALE_SENGLANGUAGE),;
            GetLInfo(lnLocale, LOCALE_SABBREVLANGNAME),;
            GetLInfo(lnLocale, LOCALE_SNATIVELANGNAME),;
            GetLInfo(lnLocale, LOCALE_ICOUNTRY),;
            GetLInfo(lnLocale, LOCALE_SCOUNTRY),;
            GetLInfo(lnLocale, LOCALE_SENGCOUNTRY),;
            GetLInfo(lnLocale, LOCALE_SABBREVCTRYNAME),;
            GetLInfo(lnLocale, LOCALE_SNATIVECTRYNAME),;
            GetLInfo(lnLocale, LOCALE_IDEFAULTLANGUAGE),;
            GetLInfo(lnLocale, LOCALE_IDEFAULTCOUNTRY),;
            GetLInfo(lnLocale, LOCALE_IDEFAULTCODEPAGE),;
            GetLInfo(lnLocale, LOCALE_IDEFAULTANSICODEPAGE),;
            GetLInfo(lnLocale, LOCALE_IDEFAULTMACCODEPAGE),;
            GetLInfo(lnLocale, LOCALE_ILDATE),;
            GetLInfo(lnLocale, LOCALE_ILZERO),;
            GetLInfo(lnLocale, LOCALE_IMEASURE),;
            GetLInfo(lnLocale, LOCALE_IMONLZERO),;
            GetLInfo(lnLocale, LOCALE_INEGCURR),;
            GetLInfo(lnLocale, LOCALE_INEGSEPBYSPACE),;
            GetLInfo(lnLocale, LOCALE_INEGSIGNPOSN),;
            GetLInfo(lnLocale, LOCALE_SDAYNAME1),;
            GetLInfo(lnLocale, LOCALE_SMONTHNAME1);
        )
    RETURN
     
    PROCEDURE GetLInfo(nLocale, nType)
    * retrieves value for specified locale and type
        cBuffer = REPLICATE(CHR(0), 250)
        nLength = GetLocaleInfo(nLocale, nType, @cBuffer, LEN(cBuffer))
    RETURN IIF(nLength > 0, SUBSTR(cBuffer, 1, nLength), "")
     
     
     

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    4136 bytes  
    Created: 2001-07-31 12:00:00  
    Modified: 2011-02-22 03:04:55  
    Visits in 7 days: 67  
    Listed functions:
    GetLocaleInfo
    Printer friendly API declarations
    My comment:
    This code retrieves all locale records available on your system.

    At this point I do not know how to create a call-back procedure within VFP (if it is really possible), so the only replacing option is to scan a wide range of could-be locale values.
    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 (54.234.231.49)
    4 sec.Function: 'HeapWalk'
    3.53 hrs.Function: 'SetClipboardData'
    Function group: 'Clipboard'
     Function: 'WTSEnumerateProcesses'
    Function group: 'Terminal Services'
     Function: 'NetShareEnum'
    7.65 hrs.Function: 'WinHttpSendRequest'
     Function: 'CryptGetHashParam'
    Function group: 'Cryptography Reference'
    8.22 hrs.Function: 'TrackPopupMenuEx'
     Example: 'Displaying the associated icons and descriptions for files and folders'
    9.73 hrs.Function: 'CeGetFileSize'
    Function group: 'Remote Application Programming (RAPI)'
     Example: 'Setting the mouse capture to the specified window'
    Google
    Advertise here!