Skip to content
⌘ NSIS Forum Archive

Change the side bar image at run-time

3 posts

zenpoy#

Change the side bar image at run-time

Hi, I would like to download an image and replace the default side bar image with the downloaded image.

What I've tried was to add a resource using reshacker:

CONTROL "", 1999, STATIC, SS_BITMAP | WS_CHILD | WS_VISIBLE, 0, 0, 109, 222
Than I created a

Page custom FirstPagePre
and a matching function:


Function FirstPagePre
GetDlgItem $0 $HWNDPARENT 1999
ShowWindow $0 ${SW_SHOW}
${NSD_SetImageOLE} $0 "http://localhost/sidebar.jpg" $1
FunctionEnd
the problem is that the default image is hiding the custom image:



I also tried using inetc to download the image (a bmp image) and to use the command SetBrandingImage but I got the same result.

Thanks,

J.
Afrow UK#
Using MUI2 you can just use ${NSD_SetImage} or ${NSD_SetStretchedImage} on $mui.WelcomePage.Image (the existing image control handle) in the welcome page's show function.

Make sure you call ${NSD_FreeImage} $mui.WelcomePage.Image.Bitmap first to free the existing bitmap.

The code is in Contrib\Modern UI 2\Pages\Welcome.nsh.

Stu