comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Drive detection on win
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Drive detection on win [message #22088] Mon, 23 October 2000 22:38
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Bernard Puc wrote:
>
> Hello,
>
> Is there a way to get a list of all the disk drives available on a
> windows machine?
>


Yes,

look at get_drive_list()

regards
Reimar
Re: Drive detection on win [message #22095 is a reply to message #22088] Mon, 23 October 2000 00:00 Go to previous message
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
Hello Bernard,

> Is there a way to get a list of all the disk drives available on a
> windows machine?

I don't think there's an IDL command just for this, but then again you
won't have to go out to C for it. There's a standard Win32 function
that'll almost give you what you need, and you can call it directly
with IDL's CALL_EXTERNAL().
The function's called GetLogicalDrives and it lives in kernel32.dll - a
core component of Win9x / NT that'll always be present. You can call
it from IDL like this:
drivemask=CALL_EXTERNAL('kernel32.dll','GetLogicalDrives')
What you'll get back is a 32-bit integer that has its bits set
according to what drives are present. e.g., If you only have an A:
and a C: drive then you'll get back the value 5. It also picks up on
network drives that have been mapped to a drive letter. If it fails
for some reason then it returns zero.
Given this, you could quite easily put together some IDL code to turn
the drive mask into a STRARR of drive names.

Cheers
Peter Mason


Sent via Deja.com http://www.deja.com/
Before you buy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Unicodes in IDL.
Next Topic: Re: filename check

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:21:47 PDT 2025

Total time taken to generate the page: 0.00413 seconds