Archive: Bitmap in Dialog 105


Bitmap in Dialog 105
I changed modern.exe with ResHacker and insert a new bitmap image in a bottom part of Dialog 105 (in a bottom-left corner), but when I start installer bitmap doesn’t shown. Everything is OK when I insert a rectangle or any other control except bitmap and icon.

This is my dialog:

105 DIALOGEX 0, 0, 331, 222
STYLE DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_WINDOWEDGE
CAPTION ""
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Shell Dlg"
{
CONTROL "", 3, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 166, 201, 50, 14 , 0x00000004
CONTROL "", 1, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 201, 50, 14 , 0x00000004
CONTROL "", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 273, 201, 50, 14 , 0x00000004
CONTROL "", 1018, STATIC, SS_BLACKRECT | WS_CHILD | WS_GROUP, 15, 45, 300, 140 , 0x00000004
CONTROL "", 1044, STATIC, SS_BLACKRECT | WS_CHILD | WS_GROUP, 0, 0, 331, 193 , 0x00000004
CONTROL "", 1035, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE | WS_GROUP, 5, 193, 319, 1 , 0x00020004
CONTROL "", 1036, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE | WS_GROUP, 0, 35, 338, 1 , 0x00020004
CONTROL "", 1045, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_GROUP, 0, 193, 338, 1 , 0x00020004
CONTROL "", 1256, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 5, 188, 322, 8 , 0x00000004
CONTROL "", 1028, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_GROUP, 5, 188, 322, 8 , 0x00000004
CONTROL "", 1034, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 0, 0, 332, 35 , 0x00000004
CONTROL "", 1037, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 10, 5, 280, 10 , 0x00000004
CONTROL "", 1038, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 15, 16, 276, 16 , 0x00000004
CONTROL 103, 1039, STATIC, SS_ICON | WS_CHILD | WS_VISIBLE | WS_GROUP, 300, 8, 21, 20 , 0x00000004
CONTROL "LOGO", 1257, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE, 16, 198, 64, 22 , 0x00000004
}


I use

!define MUI_UI “my_modern.exe”

Any idea? Thanks.


Simply adding the control to the dialog resource is not enough. You have to set the image on runtime as well. You can use SetBrandingImage to do that.


My image is a icon resource in a "my_modern.exe" and I don't want to change that image in a runtime. How can I show that resource?


Only dialogs are taken from the file specified by MUI_UI and ChangeUI. You'd have to set it at runtime. It's also possible to edit the installer resources in !packhdr, but I think it'd be simpler to set it up at runtime.


Thank you for help. I used


!packhdr tempfil.exe 'ResHacker.exe -add tempfil.exe, tempfil.exe, plogo.ico, ICONGROUP, 128,'


and it's OK when I don't have Uninstaller section. But when I add Uninstaller sectin I can't compile


Error finding icon resources: installer, uninstaller icon size mismatch - see the Icon instruction's documentation for more information -- failing!
Error - aborting creation process


Plogo.ico is not in Uninstaller.exe and I think that is a problem.

Right, there's that... Use SetBrandingImage to set it at runtime, it'd be simpler.