Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Starting a dialog box for connecting to network resources and passing input parameters
Who owns the Windows Clipboard
Closing Windows
Hiding mouse cursor
Reading data from INI files
Reading STARTUPINFO structure for the current VFP session
Retrieving the IP-to-physical address mapping table
Using the Semaphore object
Retrieving geometrical parameters of the system desktop window
Running a regular FoxPro form while main VFP window is minimized
Saying "Hello World!" with VFP and WinAPI
Adding supplementary data to AVI files
Building a tree of subdirectories for a given path using FindFile functions
How to retrieve version information for the specified file
Winsock: how to retrieve a service information corresponding to a service name
Current System information
GetFileOwner - Get the owner of an NTFS file
Pocket PC: System Registry Viewer
Simple MAPI: how to resolve a name to unique address list entry
Drawing a window caption using the DrawCaption routine
Enumerating MIDI output devices
How to enumerate terminal servers within the specified Windows domain
How to test file attributes (key method for FileExists and DirectoryExists routines)
Setting and retrieving the double-click time for the mouse
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: 52  
    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 (184.72.91.94)
    7.1 hrs.Example: 'Retrieving a universal form for the drive-based path for a network resource'
     Example: 'Storing content of the Clipboard to a bitmap file'
    7.32 hrs.Example: 'Running a regular FoxPro form while main VFP window is minimized'
     Function: 'EnumJobs'
     Function: 'SetThreadExecutionState'
    8.37 hrs.Function: 'IsMenu'
     Function: 'GetCapture'
    10.11 hrs.Function: 'CreateProcessWithLogonW'
    Function group: 'Process and Thread'
     Example: 'Extended MessageBox Class'
    11.44 hrs.Example: 'Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera'
    Language: 'Visual FoxPro'
    Google
    Advertise here!