是否可以将窗口(标签)添加到现有的 MUI 页面;像安装程序页面,欢迎页面?
我想在安装程序页面添加一个新标签。我下面的代码向窗口添加了一个新的静态窗口,但它从未显示/位于其他窗口上方。我知道该窗口存在,因为我可以使用 WinSpy++ 看到它,但它位于另一个窗口后面。此外,新窗口具有有趣的样式“样式:50000000(隐藏,启用)”,而其他普通静态窗口具有样式“样式:5000008C(可见,启用)”。
如何让我的标签(静态窗口)显示?
!include nsdialogs.nsh
!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW instshow
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
OutFile "test.exe"
Function instshow
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $2 $0 1016
System::Call 'USER32::CreateWindowEx(i0,t "STATIC",t "Some option",i ${WS_CHILD}|${WS_VISIBLE},i100,i100,i100,i20,i$2,i666,i0,i0) $R2'
System::Call `user32::SetWindowPos(i $R2, i ${HWND_TOP}, i 0, i 0, i 0, i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE})` # attempt to push new label to front
# Attempt to refresh new labels parent window
GetDlgItem $R0 $HWNDPARENT 1016
ShowWindow $R0 ${SW_HIDE}
ShowWindow $R0 ${SW_SHOW}
# Attempt to refresh new label
ShowWindow $R2 ${SW_HIDE}
ShowWindow $R2 ${SW_SHOW}
FunctionEnd
Section "Dummy"
SectionEnd