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
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Enumerating data formats currently available on the clipboard
Winsock: sending email messages (SMTP, port 25)
Custom FTP Class for Visual FoxPro application
Detecting changes in connections to removable drives (VFP9)
How to download a file from the FTP server using FtpGetFile
Splash Screen for the VFP application
Mapping and disconnecting network drives
How to activate Windows Calculator
Custom HttpRequest class (WinINet)
How to convert a bitmap file to monochrome format (1 bpp)
Custom HttpRequest class (WinHTTP)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Establishing connection using the SQLDriverConnect
Using Font and Text functions
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
Displaying bitmap using the AlphaBlend function
Using WM_COPYDATA for interprocess communication (VFP9)
Extensible Storage Engine class library
Using EnumPrinters function to enumerate locally installed printers
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: 69  
    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 (23.22.76.170)
    4 sec.Example: 'Enumerating network resources'
    55.82 min.Function: 'GetAncestor'
    Function group: 'Window'
    55.87 min.Function: 'WTSEnumerateServers'
    1.5 hrs.Example: 'Accessing Adobe Reader 7.0 main menu from VFP application'
    4.04 hrs.Example: 'How to make a VFP form fading out when released (GDI+ version)'
    12.48 hrs.Function: 'UnregisterHotKey'
    Function group: 'Keyboard Input'
     Example: 'Running a regular FoxPro form while main VFP window is minimized'
    15.34 hrs.Example: 'Writing entries to custom Event Log'
     Function: 'WSAWaitForMultipleEvents'
    Function group: 'Windows Sockets 2 (Winsock)'
    15.7 hrs.Example: 'GetFocus returns a HWND value'
    Google
    Advertise here!