Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to retrieve adapter information for the local computer (including MAC address)
Dial the Net Automatically
Displaying the associated icons and descriptions for files and folders
Drawing standard Windows icons
Get the power status of your laptop computer
Retrieving current settings for an ODBC connection
Retrieving file information for the VFP executable running
Storing registration key in the resources of an executable file
Accessing examples contained in this reference from a VFP application
Disconnecting USB Mass Storage Device programmatically
Power capabilities of the system: battery, UPS, sleep and hibernation modes, processor throttling
Uploading file to the FTP server using InternetWriteFile
Winsock: reading and setting socket options
Winsock: retrieving the standard host name and IP address for the local machine
Attaching menu to a top-level form
Displaying printer-properties Property Sheet for the specified printer
How to make the caption of a VFP application flashing in the Windows task bar
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)
How to set Creation Date/Time for a folder (WinNT)
Reading VFP settings from the Windows Registry
Using the RestartDialog function -- restarting Windows
Disabling drawing in the VFP form
Passing data records between VFP applications via the Clipboard
Reading header information from AVI 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: 74  
    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-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.17.109.248)
    1.48 hrs.Example: 'Simple Window Viewer'
     Function: 'GdipCreateMatrix'
    Function group: 'GDI+ Matrix'
    2.29 hrs.Function: 'SetFocus'
    2.77 hrs.Example: 'How to run FoxPro application under different user name (impersonating user)'
     Example: 'Retrieving information about all users currently logged on to the workstation (WinNT only)'
     Function: 'DeleteEnhMetaFile'
    Function group: 'Metafile'
    4.96 hrs.Function: 'PathIsRelative'
    Function group: 'Shell Lightweight Utility APIs -- Path Functions'
     Example: 'How to print FoxPro form'
    6.86 hrs.Function: 'GetCommandLine'
     Function: 'SetDoubleClickTime'
    Function group: 'Mouse Input'
    Google
    Advertise here!