Listing Valid Drives and Drive Types 
Author Message
 Listing Valid Drives and Drive Types



Quote:
> How do I get Clarion to return a list of the valid drives on the computer
> and whether they are Local, Network or CD-Roms?

              Module('Windows API')

                !used by pathsetup to see if drive is valid
                OMIT('***',_WIDTH32_)
                GetDriveType( SIGNED),ushort,Pascal
                ***
                COMPILE('***',_WIDTH32_)                              
GetDriveType(*cstring),UNSIGNED,PASCAL,RAW,NAME('GetDriveTypeA')
                ***

DRIVE_FIXED     EQUATE( 3 )
DRIVE_REMOVABLE Equate( 2 )
DRIVE_REMOTE    EQUATE( 1 )
DRIVE_CD        EQUATE( 4 )
DriveQ               QUEUE,PRE()
DQ:Drive             STRING(1)
DQ:IconNumber        LONG
DQ:DriveType         USHORT
                     END

!16 bit version
      ?listdrives{prop:iconlist,1}='~cd16.ico'
      ?listdrives{prop:iconlist,2}='~disk16.ico'
      ?listdrives{prop:iconlist,3}='~dsket16.ico'
      ?listdrives{prop:iconlist,4}='~netwk16.ico'
      ?listdrives{prop:iconlist,5}='~ram.ico'
      ?Listdirs{prop:iconlist,1}='~fldrclsd.ico'
      ?Listdirs{prop:iconlist,2}='~fldropen.ico'
Drives               STRING('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
DriveType            USHORT

      loop I# = 1 to 26                            !Get available drives
        DriveType = GetDriveType(I# - 1)          
        if DriveType                              
          DQ:Drive = Drives[ I# ]
          case drivetype
          of drive_fixed
            DQ:iconnumber=2
          of drive_removable
            dq:iconnumber=3
          of drive_remote
            dq:iconnumber=4
          of drive_CD
            dq:iconnumber=1
          else
            dq:iconnumber=5
          .

          DQ:DriveType = DriveType                 !Add to Drive list
          add(DriveQ)
        .
      .

---
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com



Mon, 23 Apr 2001 03:00:00 GMT  
 Listing Valid Drives and Drive Types
How do I get Clarion to return a list of the valid drives on the computer
and whether they are Local, Network or CD-Roms?

Regards

John Armstrong
Business Solutions New Zealand

NZ 64+ (7) 834 8111 voice
NZ 64+ (7) 834 2117 fax



Tue, 24 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Copy file from network drive to local drive?

2. I look for a vi which allows to drive a stepper motor drive

3. Can I use Keithley 2182 drive instead of Keithley 181 drive with slight variations

4. Determining Fixed Drives From Floppy Drives

5. Relation logical drive - physical drive ?

6. How to get the drive type

7. DVD Drive Type?

8. DVD Drive Type?

9. Drive types in Windows

10. Returning drive type in Rexx

11. Q. Detecting Local drive Types.

12. Methods for distinguishing drive types?

 

 
Powered by phpBB® Forum Software