MiniForm.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit MiniForm;
- interface
- uses
- Windows, Forms;
- type
- TForm1 = class(TForm)
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.DFM}
- procedure TForm1.FormCreate(Sender: TObject);
- var
- nSize: Integer;
- hFile: THandle;
- strSize: String;
- begin
- hFile := CreateFile (PChar (ParamStr (0)),
- 0, FILE_SHARE_READ, nil, OPEN_EXISTING, 0, 0);
- nSize := GetFileSize (hFile, nil);
- CloseHandle (hFile);
- SetLength (strSize, 20);
- Str (nSize, strSize);
- Caption := 'Size = ' + strSize;
- end;
- end.