Skip to content
⌘ NSIS Forum Archive

custom background for a custom button possible?

8 posts

MyPC8MyBrain#

custom background for a custom button possible?

Hi everyone 🙂
im trying to assign a custom image background for a custom button i am calling with NSD_CreateButton ,
is that even possible?

this is the first button of 10

${NSD_CreateButton} 85.92u 46.15u 48.71u 45.54u "Button1"
    Pop $Button1
    SendMessage $Button1 ${WM_SETFONT} $hCtl_TestDesigner_Font2 0
${NSD_OnClick} $Button1 Button1Action
    SetCtlColors $Button1 "${GRAPHICAL_INSTALLER_LABELS_TEXT_COLOR}" transparent
${NSD_AddExStyle} $Button1 ${WS_EX_TRANSPARENT}|${WS_EX_TOPMOST}
    Pop $0 
(i am also using Graphical installer, Tomas you around? 😕)

TIA
Chris
Anders#
The normal button provided by Windows (and NSD_CreateButton) does not allow a lot of customization. If you look on MSDN you should be able to find which messages you can send to set a picture on the button but it does not support background images behind the button text, for that you need a custom draw button.

I believe there is a skinned button plug-in on the wiki...
MyPC8MyBrain#
i found your fixed SkinnedButton-1.2 Anders 👍

went about recreating a new CustomUI with 20 Buttons directly in it;
instead of drawing them with NSD_CreateButton so i can use SkinnedButtons,

as i'm inching closer to implementing Skinned Buttons;
i find myself stuck now with the 8 ButtonEvent limit!

Why 8 Stu why... eight? 😢

anyone has any suggestions how to get ButtonEvent to work if i have more than 8 Buttons on the same page?
or am i out of luck with this one?

TIA
Chris
Anders#
A limit like that seems strange.

Maybe you could ask Stu to rewrite it and store the address on the button HWND with SetProp/GetProp/RemoveProp if he does not want to allocate memory for whatever reason. Or just raise the limit to 25 or something.
MyPC8MyBrain#
Thank you Anders <3

i have found Stu's source included with the package,
in it i see the direct 8 limit hard coded which i manually changed to 32;
and now trying to recompile,

right now i am in compiler hell!
trying to recompile throws every possible environmental error i can hit 🙂

ATB
Chris
MyPC8MyBrain#
no luck so far recompiling this with new 32 limit or any for that matter,
i am getting every error on this planet and it just keeps failing on me 🙁

on my XP where i compile NISS just fine im getting an error that its a newer VS version,
downloaded the latest VS community; and that gives me every error available about missing files and expired commands,


anyone has suggestions?

@Stu
you around?


TIA
Chris
MyPC8MyBrain#
YaY \ o / Success!!!
managed to compile a new ButtonEvent builds with a new 32 limit! 👍

now we try SkinnedButton 🙂

ATB
Chris