感谢 546242502 提供的示例,解决了按钮透明问题。同时自定义添加的关于按钮也变成透明的了,如何解决?
同时因为是玻璃效果,添加的文本链接背景有色块,非常不美观,能否提供下透明样式?
; 腻祛眈蝠圉桀眄 耜痂矧 ISWin7 v0.5
;
; [+] 琼圜栩咫?镥疱溴豚磬 铗痂耦怅?镳铉疣黜 钺豚耱彘
;
; 项滗屦骊?Windows Vista 猁豚 礤觐痧弪磬 怦脲漶蜮梃 麇泐 猁豚 箐嚯屙?
;
; 蒡?蝈耱钼 耜痂矧 镱玮铍弪 皲咫囹?镳铉疣黜?牮? 桦?怦?铌眍 鲥腓觐?
; 朽犷蜞弪 ?Windows 7, Windows 8
;
; ?Windows XP ?Windows Vista 铐 镳铒篑赅弪 桧桷栲腓玎鲨?
; 黩?礤 戾弪 疣犷蝾耧铖钺眍耱?皴蜞镯桕??桴 铒屦圉桀眄 耔耱屐圊
;
; 杨玟囹咫? VoLT ( Vo1T 磬 Ru-Board )
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
Compression=lzma
SolidCompression=yes
OutputDir=.
[Files]
Source: iswin7.dll; Flags: dontcopy
[Code]
procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);
external 'iswin7_add_glass@files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);
external 'iswin7_add_button@files:iswin7.dll stdcall';
procedure iswin7_free;
external 'iswin7_free@files:iswin7.dll stdcall';
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if PageID = wpReady then
result := true;
end;
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('这是你的信息', mbInformation, mb_Ok);
end;
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', '这是网址', '', '', SW_SHOW, ewNoWait, ErrorCode)
end;
procedure InitializeWizard();
var
AboutButton: TButton;
URLLabel: TNewStaticText;
begin
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - WizardForm.CancelButton.Left - WizardForm.CancelButton.Width;
AboutButton.Top := WizardForm.CancelButton.Top;
AboutButton.Width := WizardForm.CancelButton.Width;
AboutButton.Height := WizardForm.CancelButton.Height;
AboutButton.Caption := '关于(&A)';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;
URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + 10;
URLLabel.Caption := '演示示例';
URLLabel.Font.Style := [fsBold, fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Font.Name := '宋体';
URLLabel.Font.Height := ScaleY(-13);
URLLabel.Parent := WizardForm;
URLLabel.Hint := '演示示例';
URLLabel.ShowHint := True;
//isWin7
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, 47, True);
end;
procedure DeinitializeSetup();
begin
iswin7_free;
end;