Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Sending email messages with Simple MAPI
Testing Clipboard functions: emptying the clipboard
Enumerating ODBC Data Sources available on the local computer
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Compressing and decompressing files with Windows API Runtime Library routines
Moving shortcut to a specified position on the Windows Desktop
Tracking mouse movement to detect when to start dragging
Using Month Calendar Control (VFP9, Comctl32.dll)
Encapsulating access to the Windows Services in a class
How to print a bitmap file
How to print FoxPro form
Placing a button on the VFP form as a new child window
Peer-to-peer LAN messenger built with Mailslot API functions
Using FlashWindowEx to flash the taskbar button of the VFP application
Creating a window using CreateWindowEx function
Printf-style formatted text output in VFP
Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Starting a dialog box for connecting to network resources (mapping network drive)
Reading list of folders and files on FTP server
Switching between keyboard layouts
GDI+: Scrolling through large image using the mouse
How to block the PrintScreen key
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

  •  
    DECLARE INTEGER GetLogicalDrives IN kernel32
    DECLARE INTEGER GetDriveType IN kernel32 STRING nDrive
     
    LOCAL nDrivesMask, nIndex, nShift, cDrive
    nDrivesMask = GetLogicalDrives()
     
    ? "Available disk drives:"
     
    nIndex = 0
    DO WHILE .T.
        nShift = BitLShift(1, nIndex)
        cDrive = Chr(nIndex + 65) + ":"
     
        IF BitAnd(nDrivesMask, nShift) = nShift
            ? cDrive, GetDriveType(cDrive)
        ENDIF
     
        IF nShift > nDrivesMask
            EXIT
        ENDIF
     
        nIndex = nIndex + 1
    ENDDO
     
     
     

    User rating: 10/10 (1 votes)
    Rate this code sample:
    • ~
    468 bytes  
    Created: 2001-07-12 12:00:00  
    Modified: 2011-01-08 15:29:41  
    Visits in 7 days: 112  
    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 (184.72.91.94)
    6.02 hrs.Function: 'CreateDirectory'
    Function group: 'File Management'
     Function: 'GdipCreateFromHDC2'
    Function group: 'GDI+ Graphics'
    6.89 hrs.Example: 'Custom GDI+ class'
    Language: 'Visual FoxPro'
     Function: 'Escape'
    Function group: 'Printing and Print Spooler'
    9.89 hrs.Example: 'Minimizing all running applications'
     Example: 'Validating the heap of the calling process'
    10.58 hrs.Example: 'Testing serial ports'
     Function: 'PathFindFileName'
    Function group: 'Shell Lightweight Utility APIs -- Path Functions'
    14.19 hrs.Function: 'BeginPath'
     Example: 'How to put a horizontal text scrolling on the form (a news line)'
    Google
    Advertise here!