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

随声附和 提交于 2019-12-12 03:16:10

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/10645433/alter-the-z-index-of-windows-on-a-nsis-mui2-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!