Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Displaying the drive type value
How to display picture stored in enhanced-format metafile (*.emf)
Retrieving information about the main VFP window
Accessing Windows Control Panel from VFP Application
Dial the Net Automatically
Get the power status of your laptop computer
Retrieving the rectangle area where the mouse cursor is confined
Enumerating network interfaces on the local computer
The DetectAutoProxyUrl function identifies the auto-config script location
Using GetFileSize
Using mailslots to send messages on the network
How to release and renew a lease on an IP address previously obtained through Dynamic Host Configuration Protocol (DHCP)
Reading and setting explicit Application User Model ID for the current process (Win7)
Retrieving a universal form for the drive-based path for a network resource
Using LoadLibrary
Verifying a file using the Authenticode policy provider
Winsock: retrieving information from a host database for a given host name
Creating a clipping region from the path selected into the device context of a form
GDI+: retrieving list of available image encoders and image decoders
Transparent Menu Class (requires VFP9)
Using an Event Object. Part A: running an application that creates an Event object
Starting an external application in VFP using WinExec
Enumerating print processors and supporting data types installed on the specified server
GDI+: Storing content of the Clipboard to a bitmap file
Displaying the drive type value

User rating: 9/10 (1 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:

  • Basic Volume information
  • Setting the volume label
  • Disk in drive A:
  • Obtaining physical parameters for a drive: sectors, clusters, cylinders...
  • #DEFINE DRIVE_UNKNOWN     0
    #DEFINE DRIVE_NO_ROOT_DIR 1
    #DEFINE DRIVE_REMOVABLE   2
    #DEFINE DRIVE_FIXED       3
    #DEFINE DRIVE_REMOTE      4
    #DEFINE DRIVE_CDROM       5
    #DEFINE DRIVE_RAMDISK     6
    
    DECLARE INTEGER GetDriveType IN kernel32 STRING nDrive
    
    DECLARE INTEGER RealDriveType IN shell32;
        INTEGER iDrive, INTEGER fOKToHitNet
    
    LOCAL nIndex, nType
    
    FOR nIndex=Asc("A") TO Asc("Z")
    
        * both functions return identical results
        nType = RealDriveType(nIndex-65, 0)
    *    nType = GetDriveType(Chr(nIndex) + ":")
    
        DO CASE
        CASE nType = DRIVE_REMOVABLE
            ? Chr(nIndex)+":", "removable"
        CASE nType = DRIVE_FIXED
            ? Chr(nIndex)+":", "fixed"
        CASE nType = DRIVE_REMOTE
            ? Chr(nIndex)+":", "remote"
        CASE nType = DRIVE_CDROM
            ? Chr(nIndex)+":", "CDROM"
        CASE nType = DRIVE_RAMDISK
            ? Chr(nIndex)+":", "RAM"
        ENDCASE
    ENDFOR
    
    
    

    User rating: 9/10 (1 votes)
    Rate this code sample:
    • ~
    856 bytes  
    Created: 2001-07-12 12:00:00  
    Modified: 2005-03-07 13:16:59  
    Visits in 7 days: 153  
    Listed functions:
    GetDriveType
    RealDriveType
    Printer friendly API declarations
    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-2018 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.6.39), 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.240.119)
    4 sec.Function: 'SetVolumeMountPoint'
    Function group: 'File System'
    10 sec.Function: 'CeDeleteRecord'
    Function group: 'Remote Application Programming (RAPI)'
    12 sec.Function: 'WNetOpenEnum'
    Function group: 'Windows Networking'
    15 sec.Function: 'FindFirstVolume'
    Function group: 'File System'
    18 sec.Example: 'Saying "Hello World!" with VFP and WinAPI'
    20 sec.Function: 'PathGetShortPath'
    Function group: 'Shell Lightweight Utility APIs -- Path Functions'
    22 sec.Function: 'CreateStreamOnHGlobal'
    Function group: 'COM'
    24 sec.Function: 'gethostbyaddr'
    Function group: 'Windows Sockets 2 (Winsock)'
    31 sec.Function: 'GetMonitorCapabilities'
    Function group: 'Monitor Configuration (Vista)'
    32 sec.Function: 'socket'
    Function group: 'Windows Sockets 2 (Winsock)'
    Google
    Advertise here!