const
Color = clblack;
var
ListBox: TListBox;
DiskListLabel,
PercentLabel: TNewStaticText;
function GetHardDriveFreeSpace(hdd: integer): Integer; external 'hwc_GetHardDriveFreeSpace@files:get_hw_caps.dll stdcall';
function GetHardDriveName(hdd: integer): PChar; external 'hwc_GetHardDriveName@files:get_hw_caps.dll stdcall';
function GetHardDriveTotalSpace(hdd: integer): Integer; external 'hwc_GetHardDriveTotalSpace@files:get_hw_caps.dll stdcall';
function GetHardDrivesCount(): Integer; external 'hwc_GetHardDrivesCount@files:get_hw_caps.dll stdcall';
function NumToStr(Float: Extended): string;
begin
Result:=Format('%.2n', [Float]);
StringChange(Result, ',', '.');
while ((Result[Length(Result)]='0') or (Result[Length(Result)]='.')) and (Pos('.',Result)>0) do SetLength(Result,Length(Result)-1);
end;
function TBorGBorMB(Float: Extended): string;
// функция определения ТБ, ГБ или МБ
begin
if Float<1024 then Result:=NumToStr(Float)+' МБ'
else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' ГБ'
else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' ТБ'
end;
procedure CreatePageComponents;
var
i, count: Integer;
begin
DiskListLabel := TNewStaticText.Create(WizardForm);
with DiskListLabel do
begin
Caption := ExpandConstant('{cm:DiskSpace}');
Parent := WizardForm.SelectDirPage;
AutoSize := False;
Font.Size := 9;
Font.Name := 'Courier New';
Font.Color := clLime;
SetBounds(ScaleX(2), ScaleY(105), ScaleX(300), ScaleY(15));
end;
ListBox := TListBox.Create(WizardForm);
with ListBox do
begin
Parent := WizardForm.SelectDirPage;
Font.Name := 'Fixedsys';
Font.Size := 10;
Font.Color := clLime;
SetBounds(ScaleX(2), ScaleY(125), ScaleX(185), ScaleY(75));
end;
count:= GetHardDrivesCount();
for i:= 0 to count - 1 do
ListBox.Items.Add(GetHardDriveName(i)+ ' ' + IntToStr((GetHardDriveFreeSpace(i)*100) div GetHardDriveTotalSpace(i)) + '% '+ TBorGBorMB(GetHardDriveFreeSpace(i)));
with WizardForm.DiskSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Font.Size := 9;
Font.Name := 'Courier New';
Font.Color := clblack; ------------------------------------------- [B]Вот тут вроде правильно написал, а цвет всё равно белый !!![/B]
SetBounds(ScaleX(200), ScaleY(357), ScaleX(445), ScaleY(15));
end;
end;
procedure HideComponents;
begin
WizardForm.GroupBrowseButton.Hide;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
HideComponents;
end;
procedure InitializeWizard2();
begin
CreatePageComponents;
end;
procedure initializeWizard3();
begin
WizardForm.BorderIcons:= [biHelp];
end;
procedure InitializeWizard4();
begin
WizardForm.Font.Color:=clLime;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=clblack;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.GroupEdit.Color:=Color;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.WelcomeLabel1.Font.Color:=clLime;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.FinishedLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=Color;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Font.Color:=clLime;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
WizardForm.PageNameLabel.Font.Color:=clLime;
WizardForm.Bevel.visible:=False;
WizardForm.BeveledLabel.visible:=False;
WizardForm.Bevel1.visible:=False;
end;
procedure InitializeWizard();
begin
InitializeWizard2();
InitializeWizard3();
InitializeWizard4();
end;[/SPOILER]