繁体   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