Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to display Windows On-Screen Keyboard
How to print a bitmap file
Winsock: sending email messages (SMTP, port 25)
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
System Image List Viewer
Custom HttpRequest class (WinHTTP)
Creating the Save dialog box to specify the drive, directory, and name of a file to save
The window and its ancestors
How to convert a bitmap file to monochrome format (1 bpp)
Printing Image File, programmatically set print page orientation to landscape
Mapping and disconnecting network drives
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Custom FTP Class for Visual FoxPro application
Using EnumPrinters function to enumerate locally installed printers
Displaying the associated icons and descriptions for files and folders
How to download a file from the FTP server using FtpGetFile
How to activate Windows Calculator
Sending email messages with Simple MAPI
Confining Windows calculator inside the VFP main window
Windows Shell Icons displayed and exported to ICO files (Vista)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Retrieving list of available disk drives

User rating: 10/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
Versions:
click to open
Before you begin:
Find removable, fixed, CD-ROM, RAM disk, and network drives available on the local system.

See also:
  • Disconnecting USB Mass Storage Device programmatically
  • Mapping and disconnecting network drives in FoxPro application
  • Enumerating network resources
  • Enumerating Volumes and Volume Mounting Points (NTFS)
  • Disk in drive A:
  • How to detect when a removable drive gets connected or disconnected

  •  
    oService = GetObject("winmgmts:\\.\root\cimv2")
     
    oDrives = oService.ExecQuery("SELECT * " +;
        "FROM Win32_LogicalDisk")  &&  WHERE DriveType=4
     
    CREATE CURSOR cs (;
        drvletter C(2), drvtype I, descript C(30), provider C(100);
    )
     
    FOR EACH oDrive IN oDrives
        WITH oDrive
            INSERT INTO cs VALUES (;
                .DeviceId, .DriveType,;
                NVL(.Description,""), NVL(.ProviderName,"");
            )
        ENDWITH
    NEXT
     
    GO TOP
    BROWSE NORMAL NOWAIT
     
     
     

    User rating: 10/10 (1 votes)
    Rate this code sample:
    • ~
    439 bytes  
    Created: 2001-07-12 12:00:00  
    Modified: 2011-01-08 15:29:41  
    Visits in 7 days: 73  
    Listed functions:
    GetDriveType
    GetLogicalDrives
    Printer friendly API declarations
    My comment:
    DriveType:
    0 Unknown
    1 No Root Directory
    2 Removable Disk
    3 Local Disk
    4 Network Drive
    5 Compact Disc
    6 RAM Disk

    Related VFP functions: DRIVETYPE(), SYS(5), DISKSPACE().
    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.242.233.11)
    3 sec.Example: 'Converting command-line string to a set of Unicode argument strings (WinNT only)'
    50 min.Example: 'How to copy the image of a form to the Clipboard using Bitmap API functions'
    50.07 min.Example: 'Splash Screen for the VFP application'
    50.1 min.Function: 'WNetAddConnection2'
    1.86 hrs.Function: 'RpcStringFree'
    Function group: 'Remote Procedure Call (RPC)'
     Function: 'PlaySound'
    3.21 hrs.Function: 'SQLTables'
     Example: 'How to print picture stored in enhanced-format metafile (*.emf)'
     Example: 'Displaying bitmap using the AlphaBlend function'
    3.55 hrs.Example: 'Splash Screen for the VFP application'
    Google
    Advertise here!