>SNIP
>>You could do it with a bit more trouble in Delphi or VB6 or later, but they have real strong datatyping and structures and pointers and unions, oh my!
>
>Actually, I wouldn't do it that way at all in Delphi. Delphi has a function: GetMediaID that will examine a disk's serial number. GetMediaID is a wrapper around the Windows GetVolumeInformation API call.
>
>Wouldn't something like the below Delphi code be useful in VFP?
>
>
>var
> ID : MediaIDType;
>begin
> GetMediaID2('C', ID);
> ListBox1.Items.Add('Volume Label = ' +
> StrPas(ID.VolumeLabel));
> ListBox1.Items.Add('File System = ' +
> StrPas(ID.FileSystemID));
> ListBox1.Items.Add('Serial Number = ' +
> IntToStr(ID.SerialNumber));
>
>
>Actually, shouldn't the Windows Getvolumeinformation return the same information?
It does, and it fails to provide any useful information on the physical disk extents. IOW, you can do this in VFP. DeviceIoControl is a far more complex topic. And I have C++ to deal with this if I need it, and the ability to create functions that integrate seamlessly in VFP through FLLs. IOW, use the right tool and it's not a ptoblem. I can do some things in the VFP environment that wouyld be horrendous to implement in the Delphi environment. BFD.
And the API function is case-sensitive.
C++ - because there's a ton of sh!t you can't do well otherwise...