Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to display Windows On-Screen Keyboard
How to print a bitmap file
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Winsock: sending email messages (SMTP, port 25)
System Image List Viewer
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Creating the Save dialog box to specify the drive, directory, and name of a file to save
Custom HttpRequest class (WinHTTP)
Printing Image File, programmatically set print page orientation to landscape
How to convert a bitmap file to monochrome format (1 bpp)
The window and its ancestors
Mapping and disconnecting network drives
How to download a file from the FTP server using FtpGetFile
Using EnumPrinters function to enumerate locally installed printers
Custom FTP Class for Visual FoxPro application
Displaying the associated icons and descriptions for files and folders
Displaying icons in the system tray (VFP9)
How to activate Windows Calculator
Drawing Windows predefined bitmaps using the LoadBitmap functions
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Sending email messages with Simple MAPI
One more way to retrieve environment strings

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
Before you begin:
See also:
  • Creating INI file and adding strings to it
  • Reading and setting Environment variables
  • Storing environment strings in cursor
  •  
    DECLARE INTEGER ExpandEnvironmentStrings IN kernel32;
        STRING   lpSrc,;
        STRING @ lpDst,;
        INTEGER  nSize
     
    ? "COMPSPEC=",     getVar ("%comspec%")
    ? "COMPUTERNAME=", getVar ("%computername%")
    ? "USERDOMAIN=",   getVar ("%userdomain%")
    ? "USERNAME=",     getVar ("%username%")
    ? "USERPROFILE=",  getVar ("%userprofile%")
    ? "SYSTEMROOT=",   getVar ("%systemroot%")
    ? "TEMP=",         getVar ("%temp%")
    ? "TMP=",          getVar ("%tmp%")
    ? "PATH=",         getVar ("%path%")
     
    FUNCTION  getVar (lcVarname)
        LOCAL lnBufferSize, lcResult
        lnBufferSize = 2048
        lcResult = SPACE(lnBufferSize)
        lnResult = ExpandEnvironmentStrings (lcVarname, @lcResult, lnBufferSize)
    RETURN IIF(lnResult > 0, LEFT(lcResult, AT(Chr(0), lcResult)-1), "#nothing#")
     
     

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    759 bytes  
    Created: 2001-09-04 12:00:00  
    Modified: 2008-11-03 15:26:13  
    Visits in 7 days: 50  
    Listed functions:
    ExpandEnvironmentStrings
    Printer friendly API declarations
    My comment:
    If there is no corresponding environment variable, this function returns the input parameter unchanged.
    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.108.167)
    1.69 hrs.Example: 'How to print FoxPro form -- II'
     Example: 'Converting an HTTP time/date string to a SYSTEMTIME structure'
    3.32 hrs.
    Function group: 'GDI+ Graphics'
     Example: 'Retrieving IP statistics for the computer'
    5.1 hrs.Function: 'MAPISendMail'
    5.56 hrs.Function: 'GetFileAttributes'
    Function group: 'File Management'
     Example: 'How to retrieve version information for the specified file'
     Function: 'waveOutGetPosition'
    Function group: 'Windows Multimedia'
    6.9 hrs.Function: 'GetSystemMetrics'
    Function group: 'System Information'
     Function: 'CloseClipboard'
    Function group: 'Clipboard'
    Google
    Advertise here!