Unit unit1;
Interface
Uses
Windows, messages, sysutils, variants, classes, graphics, controls, forms,
Dialogs, stdctrls, filectrl;
Type
Tform1 = Class (tform)
Drivecombox1: tdrivecombobox;
Edit1: tedit;
Label1: tlabel;
Edit2: tedit;
Label2: tlabel;
Procedure drivecombobox1change (Sender: tobject );
Private
{Private Declarations}
Public
{Public declarations}
End;
VaR
Form1: tform1;
Implementation
{$ R *. DFM}
Procedure tform1.drivecombobox1change (Sender: tobject );
VaR
Driver: Char;
Userfreebytes, totalbytes, freebytes: int64;
Begin
Driver: = self. drivecombobox1.drive;
Getdiskfreespaceex (pchar (driver + ': \'), userfreebytes, totalbytes, @ freebytes );
Edit1.text: = formatfloat ('###,## 0', totalbytes) + 'byte ';
Edit2.text: = formatfloat ('###,## 0', freebytes) + 'byte ';
End;
End.
Form
Object form1: tform1
Left = 1, 192
Maximum = 107
Width = 216
Height = 155
Caption = 'drives'
Color = clbtnface
Font. charset = default_charset
Font. Color = clwindowtext
Font. Height =-13
Font. Name = 'Ms sans serif'
Font. Style = []
Oldcreateorder = false
Pixelsperinch = 96
Textheight = 16
Object label1: tlabel
Left = 8
Top = 56
Width = 57
Height = 16
Autosize = false
Caption = #24635 #23481 #37327 ':'
End
Object label2: tlabel
Left = 8
Top = 88
Width = 73
Height = 16
Autosize = false
Caption = #21097 #20313 #23481 #37327 ':'
End
Object drivecombox1: tdrivecombobox
Left = 8
Top = 16
Width = 193
Height = 22
Taborder = 0
Onchange = drivecombobox1change
End
Object edit1: tedit
Left = 80
Top = 48
Width = 121
Height = 24
Taborder = 1
TEXT = 'edit1'
End
Object edit2: tedit
Left = 80
Top = 80
Width = 121
Height = 24
Taborder = 2
TEXT = 'edit1'
End
End