简体   繁体   English

将窗口添加到现有的MUI页面

[英]Add a window to an existing MUI Page

Is it possible to add a window(a Label) to an existing MUI page; 是否可以将窗口(标签)添加到现有的MUI页面; like the installer page, welcome page? 例如安装程序页面,欢迎页面?

I would like to add a new label to the installer page. 我想在安装程序页面上添加一个新标签。 My code below adds a new Static window to the window but its never shown/sits above other windows. 我下面的代码在该窗口中添加了一个新的“静态”窗口,但是它从未显示/位于其他窗口之上。 I know the window exists because I can see it using WinSpy++ but it sits behind another window. 我知道该窗口存在,因为我可以使用WinSpy ++看到它,但它位于另一个窗口后面。 Also the new window has a funny style "Style: 50000000 (hidden, enabled)" whilst other normal static windows have the style "Style: 5000008C (visible, enabled)". 另外,新窗口具有有趣的样式“ Style:50000000(隐藏,启用)”,而其他普通静态窗口的样式为“ Style:5000008C(可见,启用)”。

How can I get my label(Static Window) to show? 如何显示我的标签(静态窗口)?

!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

Ok heres how to do it. 好的,这是怎么做的。 Thanks for the advice Anders 感谢您的建议安德斯

!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
    System::Call 'USER32::CreateWindowEx(i0,t "STATIC",t "Some text",i ${WS_CHILD}|${WS_VISIBLE},i100,i100,i100,i20,i $0,i222,i0,i0) $R2'

    GetDlgItem $1 $0 1027
    GetDlgItem $2 $0 222
    SendMessage $1 ${WM_GETFONT} 0 0 $3
    SendMessage $2 ${WM_SETFONT} $3 1
FunctionEnd


Section "Dummy"

SectionEnd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM