Skip to content
⌘ NSIS Forum Archive

Skinned Window

6 posts

dragonpiper#

Skinned Window

Is it possible to draw an image around the install window or set the install window to a png or gif without using Graphical-Installer ?

I tried using the hack at http://www.rohitab.com/discuss/topic...-in-cc-part-1/

to remove the title bar and border and make a specific color transparent for when i set the background image but it doesn't make the color transparent.

The code I am using is


System::Call "user32::GetWindowLong(i $HWNDPARENT, i ${GWL_STYLE} )i.r1"
System::Call 'user32::SetWindowLong(i $HWNDPARENT,i -16,i $R1|${WS_EX_LAYERED} ) i.R1'
System::Call 'user32::SetLayeredWindowAttributes(i $HWNDPARENT, i ${g_ColourKey}, i 0, i ${LWA_COLORKEY}'
Am i doing something wrong ?
Anders#
Originally Posted by dragonpiper View Post
Am i doing something wrong ?
Yes. GWL_EXSTYLE not GWL_STYLE! $R1 should be $1 and SetLayeredWindowAttributes is missing the closing parens so basically all your source lines contained bugs 😢


Page InstFiles

Section
!define g_ColourKey $2 ; It is not very helpful when you don't include the definition of custom defines in your question so I'm forced to pick something I know will be valid
System::Call 'user32::GetSysColor(i15)i.r2' ; We will make the 3dface color transparent

!define GWL_EXSTYLE -20
!define WS_EX_LAYERED 0x80000
!define LWA_COLORKEY 1
System::Call "user32::GetWindowLong(i $HWNDPARENT,i ${GWL_EXSTYLE})i.r1"
System::Call 'user32::SetWindowLong(i $HWNDPARENT,i ${GWL_EXSTYLE},i $1|${WS_EX_LAYERED})'
System::Call 'user32::SetLayeredWindowAttributes(i $HWNDPARENT,i ${g_ColourKey},i 0,i ${LWA_COLORKEY})'
SectionEnd
dragonpiper#
Ah i see the typo now. It is now transparent. Is there a way to make the window the size of my image or does the require hacking as well ?

I also am trying to make the window drag gable from anywhere.
dragonpiper#
I'm trying to achieve something like this where the 0xFFFFFF parts the my Splash.bmp will be transparent. I've intred another implementation which i have commented out but the window size is to small and the 0xFFFFFF areas of the image are transparent.

dragonpiper#edited
I was able to make it transparent using 2 methods. Now i'm wondering how do i make the window the same size as my image and shift the normal elements by an offset ?
T.Slappy#
Originally Posted by dragonpiper View Post
I was able to make it transparent using 2 methods. Now i'm wondering how do i make the window the same size as my image and shift the normal elements by an offset ?
That is too complicated.

In Graphical Installer we use exactly the opposite approach: the image is sized to window dimensions.

It is less painful than to move each control and make many calculations...

(I cannot believe i am helping in this topic 🙂