Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Setting properties of the window: caption and user-defined value
How to generate UUID values
Retrieving list of Global Atom names
Retrieving the rectangle area where the mouse cursor is confined
Retrieving top-child window for the VFP form
Using the heap of the calling process to allocate memory blocks
Using the Semaphore object to allow only one instance of VFP application running
Winsock: how to retrieve the protocol information corresponding to a protocol number
GDI+: loading image file, drawing on it, saving the result to another file
Listing INF files in a specified directory
Pocket PC: Folder Viewer
Retrieving a handle to DLL and address of an exported function in it
Accessing Windows Control Panel from VFP Application
Creating hash values for the list of names
Enumerating network interfaces on the local computer
GDI+: converting image file to another graphics format
Memory usage info for current VFP session (WinNT only)
Winsock: retrieving information about available transport protocols
FindText -- the hopeless and useless Common Dialog
Retrieving default spooling directory name
Current directory of the application
Enumerating Processes -- Win9*
Obtaining MAC address through Address Resolution Protocol (ARP) request
Obtaining physical parameters for a drive: sectors, clusters, cylinders...
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: 66  
    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 (54.234.231.49)
    3.79 hrs.Example: 'Subclassing CommandButton control to create BackColor property'
    3.8 hrs.Example: 'Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.'
    5.67 hrs.
     Function: 'GetClassInfoEx'
    13.51 hrs.Example: 'Retrieving a universal form for the drive-based path for a network resource'
    13.52 hrs.Function: 'SystemParametersInfo'
    Function group: 'System Information'
    16.45 hrs.Example: 'Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)'
    17.43 hrs.Example: 'Windows Shell Icons displayed and exported to ICO files (Vista)'
     Example: 'Storing content of the Clipboard to a bitmap file'
    19.06 hrs.Example: 'Pocket PC: retrieving data from the Contacts Database'
    Google
    Advertise here!