CancerFace
Senior Member
Registered: Apr 2006
From:
|
Add Icons to a custom Page
I have created a custom page (for InstallOptionsEx) that contains among other things two fields for images/icons. I have also added two different icons in my file using a small script that injects the second icon to the header then compresses it with upx (using the --compress-icons=0 flag)
In other words in my NSIS file I have
code: !define MUI_UI "src\custom_header.exe"
!define MUI_ICON "icons\FirstIcon.ico"
!packhdr "$%TEMP%\exehead.dat" 'header.cmd'
and header.cmd is
code: "%ProgramFiles%\Resource Hacker\ResHacker.exe" -add "%TEMP%\exehead.dat", "%TEMP%\exehead.dat", "%~dps0icons\SecondIcon.ico" , ICONGROUP,104,
upx --best --compress-icons=0 "%TEMP%\exehead.dat"
Once I initiallize the page both images show FirstIcon.ico.
If I change my .ini file that generates the page, so that it points to the exe containing the icons then I get two different icons on the page, but SecondIcon.ico is displayed as if it was 32x32 extraploated to 128x128.
Is there a way to change any of the images on the page before displaying it? I am not sure how to use, say, {STM_SETICON} or something similar.Something like this:
code: InstallOptionsEx::initDialog /NOUNLOAD "$PLUGINSDIR\${IniFileName}"
Pop $R1
GetDlgItem $0 $R1 1202
SendMessage $0 ${STM_SETICON} ?? ??
I played around with the ?? using the icon index in my file etc but couldn't get it to work ...
I found a thread that suggested (for a different issue though) to use a system call to LoadIcon, but then I am not sure how to pass the information to the SendMessage command ...
Any ideas?
CF
Quick Link | Report this post to a moderator | IP: Logged
|