installationnsismodern-ui

Alter the z-index of windows on a NSIS MUI2 Page


Is it possible to set the z-index of the header bitmap window on a NSIS MUI2 Page?

I am trying to make a window that contains a large bitmap sit behind the other windows(labels, checkboxes etc.) on the MUI2 Pages MUI_PAGE_WELCOME & MUI_PAGE_COMPONENTS.

I have seen I could use SetWindowPos but how do I access/find the HWND associated with the header bitmap?

Also is there a way to set a static, label and checkboxes background to transparent? Maybe theres a Win32 flag I can use, or should I use a transparent bitmap?


Solution

  • Both options are possible.

    For accessing bitmap defined as MUI_HEADERIMAGE_BITMAP use it's ID which is 1046 (To see these IDs open appropriate .exe file in NSIS\Contrib\UIs\ folder with ResHacker)

    Then use GetDlgItem OutputVar $HWNDPARENT 1046 to get handle on it. In NSIS all WinAPI functions work well.

    1) Creating whole background is very tricky - it requires a lot of coding. Installer's window consists from outer and inner dialogs so you need to add two bitmaps (one for each dialog) As this is a lot of code I can recommend you this solution: Graphical Installer for NSIS for creating cool looking installer.

    2): Use SetCtlColors ControlHwnd TextColor transparent This works for most controls but there are some troubles with it on WinXP. The other way is to subclass every control and override it's WM_PAINT message (writing simple C plug-in).