•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 427,177 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,133 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
ShowDriveSerialNo shows it with ShowMessage GetDriveSerialNo returns a string. You don't need both.
Procedure ShowDriveSerialNo(Drive : String); // Drive as 'c:' or 'd:', ... var VolSerNum: DWORD; Dummy1, Dummy2: DWORD; begin if GetVolumeInformation(drive+'\', NIL, 0, @VolSerNum, Dummy1, Dummy2, NIL, 0) then ShowMessage(Format('%.4x:%.4x', [HiWord(VolSerNum), LoWord(VolSerNum)])); End; Function GetDriveSerialNo(Drive : String) : String; // Drive as 'x:' ... var VolSerNum: DWORD; Dummy1, Dummy2: DWORD; begin if GetVolumeInformation(drive+'\', NIL, 0, @VolSerNum, Dummy1, Dummy2, NIL, 0) then Result := Format('%.4x:%.4x', [HiWord(VolSerNum), LoWord(VolSerNum)]); End;
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)