Thread View: comp.lang.pascal.delphi.components.misc
3 messages
3 total messages
Started by Jim Macleod
Sat, 09 May 1998 00:00
How to find a disk volume label?
Author: Jim Macleod
Date: Sat, 09 May 1998 00:00
Date: Sat, 09 May 1998 00:00
6 lines
835 bytes
835 bytes
Can anyone tell me how to find the label of a disk(ette) under Delphi and/or C++ Builder? TIA -- Jim Macleod
Re: How to find a disk volume label?
Author: Jason Wallace
Date: Sun, 10 May 1998 00:00
Date: Sun, 10 May 1998 00:00
17 lines
1078 bytes
1078 bytes
Take a look at the API function 'GetVolumeInformation' -- Jason Wallace SL Software DarkElf@SLSoftware.reno.nv.us -- "We are Microsoft. Resistance is Futile. You will be Assimiliated." Jim Macleod wrote in message ... >Can anyone tell me how to find the label of a disk(ette) under Delphi >and/or C++ Builder? >TIA >-- >Jim Macleod
Re: How to find a disk volume label?
Author: Roman P. Shcherbina
Date: Tue, 12 May 1998 00:00
Date: Tue, 12 May 1998 00:00
102 lines
4004 bytes
4004 bytes
--------------4663C4EE9855AD00B75F0F20
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
>Jim Macleod wrote:
> >Can anyone tell me how to find the label of a disk(ette) under Delphi
> >and/or C++ Builder?
> >TIA
> >--
> >Jim Macleod
Hi Jim !!!
Try to do something like this :
Var
VolumeName : PChar ;
VolumeNameSize : DWORD ;
VolumeSerialNumber : PDWORD ;
MaximumComponentLength, FileSystemFlags: DWORD;
FileSystemNameBuffer : PChar;
FileSystemNameSize : DWORD;
Begin
GetMem(VolumeName,100) ;
VolumeNameSize := 100 ;
New(VolumeSerialNumber);
GetMem(FileSystemNameBuffer,100) ;
FileSystemNameSize := 100 ;
Try
If Not
GetVolumeInformation('c:\',VolumeName,VolumeNameSize,VolumeSerialNumber,
MaximumComponentLength,FileSystemFlags,
FileSystemNameBuffer,FileSystemNameSize) Then ShowMessage('Error') ;
Finally
FreeMem(VolumeName,100) ;
Dispose(VolumeSerialNumber);
FreeMem(FileSystemNameBuffer,100) ;
End ;
--
With the best wishes
Roman
--------------4663C4EE9855AD00B75F0F20
Content-Type: text/html; charset=koi8-r
Content-Transfer-Encoding: 7bit
<HTML>
<P>>Jim Macleod wrote:
<BLOCKQUOTE TYPE=CITE>>Can anyone tell me how to find the label of a disk(ette)
under Delphi
<BR>>and/or C++ Builder?
<BR>>TIA
<BR>>--
<BR>>Jim Macleod</BLOCKQUOTE>
Hi Jim !!!
<P> Try to do something like this :
<P>Var
<BR><B> VolumeName</B> : PChar ;
<BR> VolumeNameSize : DWORD ;
<BR> VolumeSerialNumber : PDWORD ;
<BR> MaximumComponentLength, FileSystemFlags: DWORD;
<BR> FileSystemNameBuffer : PChar;
<BR> FileSystemNameSize : DWORD;
<BR>Begin
<BR> GetMem(VolumeName,100) ;
<BR> VolumeNameSize := 100 ;
<BR> New(VolumeSerialNumber);
<BR> GetMem(FileSystemNameBuffer,100) ;
<BR> FileSystemNameSize := 100 ;
<BR> Try
<BR> If Not GetVolumeInformation('c:\',<B>VolumeName</B>,VolumeNameSize,VolumeSerialNumber,
<BR>
MaximumComponentLength,FileSystemFlags,
<BR>
FileSystemNameBuffer,FileSystemNameSize) Then ShowMessage('Error')
;
<BR> Finally
<BR> FreeMem(VolumeName,100) ;
<BR> Dispose(VolumeSerialNumber);
<BR> FreeMem(FileSystemNameBuffer,100) ;
<BR> End ;
<P>--
<BR>With the best wishes
<BR>
Roman
<BR> </HTML>
--------------4663C4EE9855AD00B75F0F20--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads