Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Displaying the drive type value
Enumerating Windows Sound Schemes avaialble to the current user
Starting a dialog box for connecting to network resources (mapping network drive)
Using GetNearestColor
Using MessageBeep
Using named pipes for interprocess communication
Winsock: retrieving information about available transport protocols
Displaying OS Memory Status
Enumerating Performance Counters
How to run FoxPro application under different user name (impersonating user)
Retrieving information about all users currently logged on to the workstation (WinNT only)
Using Beep and Sleep functions to make the old tin buzz sing (WinNT only?)
Using FillMemory
Winsock: changing the byte ordering
Drawing standard Windows icons
How to block the PrintScreen key
Smart Card Database Query Functions
System and Local Time values
Using an Event Object. Part B: running an application responding to events
Winsock: creating a socket that is bound to a specific service provider
GDI+: how to make VFP controls visually shake and shudder
How to retrieve version information for the specified file
Retrieving Printer Device Context using PrintDlg function
Semi-transparent Form
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: 92  
    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-2017 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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.145.124.143)
    2 sec.Function: 'waveInUnprepareHeader'
    Function group: 'Windows Multimedia'
    4 sec.
    7 sec.Example: 'Winsock: how to retrieve a service information corresponding to a service name'
    9 sec.Function: 'SetupCloseInfFile'
    Function group: 'Setup API functions'
    10 sec.Function: 'AVIStreamGetFrameOpen'
    Function group: 'Windows Multimedia'
    12 sec.Function: 'SizeofResource'
    13 sec.Function: 'capCreateCaptureWindow'
    Function group: 'Windows Multimedia'
    15 sec.Function: 'GetDiskFreeSpace'
    Function group: 'File System'
    16 sec.Function: 'mciSendString'
    Function group: 'Windows Multimedia'
    18 sec.Function: 'PlaySound'
    Function group: 'Windows Multimedia'
    Google
    Advertise here!