簡體   English   中英

如何為自定義的nsis安裝程序添加邊框

[英]How to add a border to customized nsis installer

我正在NSIS / MUI2.nsh的幫助下進行自定義安裝程序。 我正在努力為安裝程序添加邊框。

當我在歡迎頁面和結束頁面上工作時,我只需在位圖上添加邊框(只需繪制即可),並將其設置為相應地控制ID 1044。 如何在許可證,組件或目錄頁面上添加邊框?

您可以通過創建其他窗口來添加其他邊框:

OutFile Test.exe
RequestExecutionLevel user

Page License "" onLicShow
Page InstFiles

!include nsDialogs.nsh ; WS_*
Function onLicShow
GetDlgItem $5 $hWndParent 0xFFFFFFFF
ShowWindow $5 0 ; Hide the original line
System::Call 'USER32::GetWindowRect(pr5,@r0)' ; NSIS v3+
System::Call 'USER32::MapWindowPoints(p0, p$hWndParent, pr0, i1)'
System::Call '*$0(i.r1,i.r2,i.r3,i.r4)'
IntOp $2 $2 - 2 ; Adjust a little up
System::Call 'USER32::CreateWindowEx(i0, t"STATIC", p0, i ${WS_VISIBLE}|${WS_CHILD}, i 0, i r2, i 9999, i 4, p$hWndParent, p0, p0, p0)p.r0'
SetCtlColors $0 "" 0xff0000 ; Red

System::Call 'USER32::CreateWindowEx(i0, t"STATIC", p0, i ${WS_VISIBLE}|${WS_CHILD}, i 0, i 0, i 4, i 9999, p$hWndParent, p0, p0, p0)p.r0'
SetCtlColors $0 "" 0x00ff00 ; Green

System::Call 'USER32::GetClientRect(p$hWndParent,@r0)' ; NSIS v3+
System::Call '*$0(i,i,i.r3,i)'
IntOp $3 $3 - 4 ; X = Window width - border width
System::Call 'USER32::CreateWindowEx(i0, t"STATIC", p0, i ${WS_VISIBLE}|${WS_CHILD}, i $3, i 0, i 4, i 9999, p$hWndParent, p0, p0, p0)p.r0'
SetCtlColors $0 "" 0xffff00 ; Yellow

System::Call 'USER32::CreateWindowEx(i0, t"STATIC", p0, i ${WS_VISIBLE}|${WS_CHILD}, i 0, i 0, i 9999, i 4, p$hWndParent, p0, p0, p0)p.r0'
SetCtlColors $0 "" 0xffffff ; White

FindWindow $1 "#32770" "" $hWndParent ; Find the inner dialog
System::Call 'USER32::CreateWindowEx(i0, t"STATIC", p0, i ${WS_VISIBLE}|${WS_CHILD}, i 0, i 0, i 9999, i 7, p$1, p0, p0, p0)p.r0'
SetCtlColors $0 "" 0x0000ff ; Blue
FunctionEnd

內部對話框中的窗口僅在該頁面上可見,其他窗口在所有頁面上可見。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM