открытие не знаю а вот закрытие такПокажите пожалуйста пример плавного открытия и закрытия инсталлятора... Зарание спасибо...
const
AW_BLEND = $00080000;
AW_HIDE = $00010000;
function AnimateWindow(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): Boolean;
external 'AnimateWindow@user32 stdcall';
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_OKCANCEL) = IDOK then
begin
Confirm := False;
AnimateWindow(WizardForm.Handle, 2500, AW_BLEND or AW_HIDE);
Cancel := True;
end else
Cancel := False;
end;
Покажите пожалуйста пример плавного открытия и закрытия инсталлятора... Зарание спасибо...
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=userdocs:InnoSetupTest.
[ Code]
const
AW_ACTIVATE = $00020000;
AW_BLEND = $00080000;
AW_HIDE = $00010000;
function AnimateWindow(hWnd: HWND; dwTime: DWORD; dwFlags: DWORD): Boolean;
external 'AnimateWindow@user32 stdcall';
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_OKCANCEL) = IDOK then
begin
Confirm := False;
AnimateWindow(WizardForm.Handle, 2500, AW_BLEND or AW_HIDE);
Cancel := True;
end else
Cancel := False;
end;
procedure InitializeWizard();
begin
AnimateWindow(WizardForm.Handle, 2500, AW_BLEND or AW_ACTIVATE);
end;
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 MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' Ìá' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Ãá' else
Result:= NumToStr(Float/(1024*1024))+' Òá';
end;
procedure DirEditOnChange(Sender: TObject);
var Drive: String;
begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
TotalSpaceLabel1.Caption:= ExpandConstant('{cm:TotalSpaceLabel} ') +MbOrTb(TotalMB);
TotalSpaceLabel2.Caption:= ExpandConstant('{cm:TotalSpaceLabel} ') +MbOrTb(TotalMB);
FreeSpaceLabel1.Caption:= ExpandConstant('{cm:FreeSpaceLabel} ') +MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
FreeSpaceLabel2.Caption:= ExpandConstant('{cm:FreeSpaceLabel} ') +MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
InstallSpacelabel1.Caption:= ExpandConstant('{cm:InstallSpacelabel} ') +MbOrTb({#NeedInstallSize});
InstallSpacelabel2.Caption:= ExpandConstant('{cm:InstallSpacelabel} ') +MbOrTb({#NeedInstallSize});
NeedSpaceLabel1.Caption:= ExpandConstant('{cm:NeedSpaceLabel} ') +MbOrTb({#NeedSize});
NeedSpaceLabel2.Caption:= ExpandConstant('{cm:NeedSpaceLabel} ') +MbOrTb({#NeedSize});
WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize}) ;
end;
var
TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
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 MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' Мб' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Гб' else
Result:= NumToStr(Float/(1024*1024))+' Тб';
end;
procedure DirEditOnChange(Sender: TObject);
var Drive: String;
begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
TotalSpaceLabel.Caption:= ExpandConstant('{cm:TotalSpace} ')+MbOrTb(TotalMB);
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ')+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'% )';
InstallSpacelabel.Caption:= ExpandConstant('{cm:InstallSpace} ')+MbOrTb({#NeedInstallSize});
NeedSpaceLabel.Caption:= ExpandConstant('{cm:NeedSpace} ')+MbOrTb({#NeedSize});
WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize});
[color=Red][b]if WizardForm.NextButton.Enabled then FreeSpaceLabel.Font.Color:=$000000 else FreeSpaceLabel.Font.Color:=$0000FF;[/b][/color]
end;
procedure InitializeWizard();
begin
TotalSpaceLabel:= TLabel.Create(WizardForm);
TotalSpaceLabel.AutoSize:= False;
TotalSpaceLabel.SetBounds(0, 120, 300, 20);
TotalSpaceLabel.Parent:= WizardForm.SelectDirpage;
FreeSpaceLabel:= TLabel.Create(WizardForm);
FreeSpaceLabel.AutoSize:= False;
FreeSpaceLabel.SetBounds(0, 140, 300, 20);
FreeSpaceLabel.Parent:= WizardForm.SelectDirpage;
InstallSpacelabel:= TLabel.Create(WizardForm);
InstallSpacelabel.AutoSize:= False;
InstallSpacelabel.SetBounds(0, 160, 300, 20);
InstallSpacelabel.Parent:= WizardForm.SelectDirpage;
NeedSpaceLabel:= TLabel.Create(WizardForm);
NeedSpaceLabel.AutoSize:= False;
NeedSpaceLabel.SetBounds(0, 180, 300, 20);
NeedSpaceLabel.Parent:= WizardForm.SelectDirpage;
WizardForm.DirEdit.OnChange:=@DirEditOnChange;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then begin
DirEditOnChange(nil)
end;
end;[/SPOILER]
sergey3695, Я без скина буду юзать. Правда мне нужно зарание знать как будет выглядеть инстяллятор...animatewindow со скином не пропрет
А то каша в головемда... с фантазией у тебя проблемка
не запускаеться с таким кодомandrey_167, mycancelbutton.hide пробовал?
даandrey_167, у тебя исдон?