Archive: Large header image and header text in front.


Large header image and header text in front.
Hi,

Is it possible to have the header text in front of a large header image and how to do that?.

This is what i have:
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_LEFT
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!define MUI_HEADERIMAGE_BITMAP "head.bmp"; 250x57
!define MUI_HEADER_TRANSPARENT_TEXT

Half of the text is hidden behind the image.

Need help on this.

/Ezac


Hi,

I have the exact same problem.

How do you put title in front of header bitmap image?

Thanks a lot!


The easiest way is using a modified ui file, or you can use System::Call user32::SetWindowPos to change the Z-order of the two text control.


I'll try this.

Thanks a lot!


I had this exact same problem a while back. Here is the macro I wrote in my installer to fix it:

!macro FIXWINDOWHEADER fixHeader
Function ${fixHeader}fixWindowHeader
GetDlgItem $0 $HWNDPARENT 1046 ;header image
GetDlgItem $1 $HWNDPARENT 1037 ;header text
GetDlgItem $2 $HWNDPARENT 1038 ;header subtext
System::Call "User32::SetWindowPos(i, i, i, i, i, i, i) b ($1, $0, 30, 15, 497, 57, 0)" ;this also moves the text a little to the left so it doesn't over-write part of the header image
System::Call "User32::SetWindowPos(i, i, i, i, i, i, i) b ($2, $0, 40, 30, 497, 57, 0)"
FunctionEnd
!macroEnd

Basically, the SetWindowPos calls above place the header text and sub-text on top of the header image. Also, note that they slightly changed the position of the text but that is due to my specific header image and may not apply to you. See the help for SetWindowPos here: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

Also, I found issues with using '!define MUI_HEADER_TRANSPARENT TEXT' so if things don't work for you, consider getting rid of this as well and see what happens. Hope this helps.


Do not need to modify the size of control:

GetDlgItem $0 $HWNDPARENT 1037
System::Call "User32::SetWindowPos(ir0,i0,i0,i0,i0,i0,i3)"
GetDlgItem $0 $HWNDPARENT 1038
System::Call "User32::SetWindowPos(ir0,i0,i0,i0,i0,i0,i3)"

The 2nd parameter i0 means i${HWND_TOP}, 7th parameter i3 means i${SWP_NOSIZE}|${SWP_NOMOVE}
Or use like this:

GetDlgItem $0 $HWNDPARENT 1046
GetDlgItem $1 $HWNDPARENT 1037
System::Call "User32::SetWindowPos(ir0,ir1,i0,i0,i0,i0,i3)"
GetDlgItem $1 $HWNDPARENT 1038
System::Call "User32::SetWindowPos(ir0,ir1,i0,i0,i0,i0,i3)"

Add these to your custom defined "ONGUIINIT" function.