Archive: Add Static window to existing MUI Page


Add Static window to existing MUI Page
Hello

Is it possible to add a window(a Label) to an existing MUI page; 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. Also the new window has a funny style "Style: 50000000 (hidden, enabled)" whilst other normal static windows have the style "Style: 5000008C (visible, enabled)".

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

If it is the welcome or finish pages you can add new controls to it using nsDialogs. If it is any of the other pages you can add controls at run time as you are doing (I cannot say why it isn't working for you though) or you can add it to the UI resource using Resource Hacker.

The UIs are in Contrib\UIs. You can copy modern.exe to your script directory, modify it and then use it in your script with !define MUI_UI modern_modified.exe.

Stu