我爱你:请教虎版,这样的水波效果实现了为什么无法正常显示右下角自定义链接的效果。自定义添加的类似关于按钮无法正常显示,可有解救方法。或者麻烦版主贴一下能使用的代码,让小弟参考学习。 ..
(2015-09-09 13:20)
水波效果和自定义链接效果两者相互没有关系的,当然相互不会影响。下面给你一个精简的脚步。
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
[Files]
Source: "开始位图.bmp"; Flags: dontcopy
Source: "waterctrl.dll"; Flags: dontcopy
[CODE]
var
bmp: TBitmap;
AboutButton: TLabel;
function enablewater(ParentWnd: HWND; Left, Top: integer; Bmp: HBITMAP; WaterRadius, WaterHeight: integer): BOOL;
external 'enablewater@files:waterctrl.dll stdcall';
function waterblob(x, y: integer; radius, height: integer): BOOL;
external 'waterblob@files:waterctrl.dll stdcall';
function flattenwater(): BOOL; external 'flattenwater@files:waterctrl.dll stdcall';
function disablewater(): BOOL; external 'disablewater@files:waterctrl.dll stdcall';
function setwaterparent(ParentWnd: HWND): BOOL; external 'setwaterparent@files:waterctrl.dll stdcall';
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('这是你的说明...', mbInformation, MB_OK);
end;
procedure AboutButtonOnMouseEnter(Sender: TObject);
begin
AboutButton.Font.Style := [fsBold];
end;
procedure AboutButtonOnMouseLeave(Sender: TObject);
begin
AboutButton.Font.Style := [];
end;
procedure InitializeWizard();
var
CancelButton: TButton;
begin
ExtractTemporaryFile('开始位图.bmp');
bmp := TBitmap.create;
bmp.LoadFromFile(ExpandConstant('{tmp}\开始位图.bmp'));
Wizardform.WelcomeLabel1.Visible:= false; // 屏蔽安装向导页面上面的文字
Wizardform.WelcomeLabel2.Visible:= false; // 屏蔽安装向导页面上面的文字
Wizardform.WizardBitmapImage.Width:= Wizardform.InnerPage.Width; // 放大图像到整个界面宽度
Wizardform.WizardBitmapImage.Height:= Wizardform.InnerPage.Height;
enablewater(WizardForm.WelcomePage.Handle, 0, 0, bmp.Handle, 3, 50);
//
CancelButton := WizardForm.CancelButton;
AboutButton := TLabel.Create(WizardForm);
AboutButton.Parent := WizardForm;
AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width;
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '关于(&A)...';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Font.Color := clBlue;
AboutButton.Cursor := crHand;
AboutButton.OnMouseEnter := @AboutButtonOnMouseEnter;
AboutButton.OnMouseLeave := @AboutButtonOnMouseLeave;
end;
procedure CurPageChanged(CurPage: Integer);
begin
if CurPage = wpWelcome then
begin
setwaterparent(WizardForm.WelcomePage.Handle);
waterblob(70, 198, 10, 1000);
end
else if CurPage = wpFinished then
begin
setwaterparent(WizardForm.FinishedPage.Handle);
waterblob(70, 198, 10, 1000);
end else
flattenwater();
end;
procedure DeinitializeSetup();
begin
disablewater();
bmp.Free;
end;