![]() |
#1 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Aero plug-in
![]() Enables Windows Aero glass effect on NSIS (outer) UI. http://nsis.sf.net/File:Aero.zip Edit: Worth noting this plug-in does nothing on < Vista or when DWM composition (glass) is disabled on installer init. The plug-in handles theme changes once it has been loaded (i.e. reverts to original UI if glass is disabled). Stu |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
Looks very nice indeed, thanks for sharing!
|
![]() |
![]() |
![]() |
#3 |
Major Dude
|
hah, funny I will try it!
Cool looking installers with custom design: www.graphical-installer.com Create Setup Pages easily: www.install-designer.com Build installers in Visual Studio 2005-2019: www.visual-installer.com or RAD Studio 2009, 2010, XE-10.4 Sydney: www.rad-installer.com |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Apr 2008
Posts: 21
|
nice plug-in, thank you very much!
|
![]() |
![]() |
![]() |
#5 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
I made a plugin similar to this a while back but I never got around to posting it since I could not find a documented value to use for the text glow size. Did you just make one up or what?
I guess I don't have to complete my version now, thanks Afrow =) IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Just used 10. You can actually get the glow size from the current theme using another API so I may change it.
I've had a report of the button text being transparent on one or two machines which doesn't seem to happen on any of mine so I might need to fix that soon. When you use the branding text with glow, it has to paint a black brush where the aero is but that results in the button text being transparent too (looks awful) and therefore I've had to do some simple button drawing myself (using WM_PAINTCLIENT). To fix the button text at the moment I'm just using WM_PAINTCLIENT onto the current DC's HBRUSH (this seems to work fine for me - but I don't really know why lol). However, I may have to use double buffering (BeginBufferedPaint) with a portion with full opacity (BufferedPaintSetAlpha) to fix properly. Will post new version today probably. Other option is owner draw the buttons but I want to avoid that. I'd rather let Windows do it for me (WM_PAINTCLIENT). Stu |
![]() |
![]() |
![]() |
#7 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
New version uploaded which uses the glow size for the current theme and fixes the button text transparency bug on some systems.
FYI to get the glow size (12 by default) you use GetThemeInt with TMT_TEXTGLOWSIZE. The theme I used is "CompositedWindow::Window". Probably worth mentioning also that if you use /nobranding then because the plug-in does not need to draw any glow text, it doesn't need to use a black brush for the aero (I use magic pink instead with SetLayeredWindowAttributes/LWA_COLORKEY). As a result, the buttons are untouched and therefore you get the proper button glow fade in/out on mouse in/out. Owner-drawn or WM_PAINT handled buttons lose this fade in/out unfortunately and there's nothing one can do about it. Even .NET apps loses this effect if you set UseCompatibleTextRendering=true for buttons. The missing effect is not noticeable though (unless you're me lol) so branding text is on by default ![]() Stu |
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
Is SetLayeredWindowAttributes + DwmExtendFrameIntoClientArea a valid thing to do? IIRC SetLayeredWindowAttributes had problems with the DWM in the early Vista days.
You are using "CompositedWindow::Window" when loading and "Window" in WM_THEMECHANGED, this can't be correct can it? Also, you are hard-coding a 2px change in what I assume is some sort of button border hack? What about alternative Visual Styles? IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#9 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Quote:
2. Well spotted. Will fix. 3. Yes. I'm having to set the inner part of the button to opaque to fix the black->transparent button text. I originally used 4px but 2px seems to be the minimum. I never thought of other themes. Not sure if there is a better way to do this without having to draw the button myself. Any ideas? Stu |
|
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
In my plugin I use one of the theme api's to calculate the size of the button IIRC
Also, you are destroying windows you don't own, this is not OK IMHO (In my Aero plugin I hide them and if aero is turned off, I display them again, 100% original layout in classic theme...) As a final note; I don't really think "_WndProc_" is the best prop name to use, it is a bit generic, I'm using "NSIS:P:Aero", feel free to using something similar (or the same, both plugins should not be used at the same time anyway) IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#11 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
So is that how your plug-in does the buttons too or does it owner-draw them?
Stu |
![]() |
![]() |
![]() |
#12 | |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
Quote:
I was going to look into adding the animation back but got bored and stopped working on the plugin... IntOp $PostCount $PostCount + 1 |
|
![]() |
![]() |
![]() |
#13 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Is it GetThemeBackgroundRegion? How would that be used with BufferedPaintSetAlpha which requires a RECT?
Stu |
![]() |
![]() |
![]() |
#14 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
I'm thinking it was GetThemeBackgroundContentRect
But you should be able to get a RECT from HRGN also... Or you can use the HRGN to mask off the HDC... IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#15 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
So far so good although I've just remembered why I had to destroy those controls instead of hiding them (at least for MUI). MUI hides/shows them itself when you enter/leave the welcome/finish pages. How did you overcome this or did you not notice this problem?
Stu |
![]() |
![]() |
![]() |
#16 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
I probably re-hide them on every page change...
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#17 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
In response to WM_NOTIFY_OUTER_NEXT? It seems that the show function gets called after that notification and so my attempts fail. Calling the old window procedure first also doesn't seem to work. I guess one option, which would also avoid any potential flickering of the controls being shown/hidden, would be to move them off the UI on plug-in load while saving their original positions...
Stu |
![]() |
![]() |
![]() |
#18 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
here's what happens when defining MUI_BGCOLOR (mind the background of those buttons)
|
![]() |
![]() |
![]() |
#19 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'll look into it thanks.
Stu |
![]() |
![]() |
![]() |
#20 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
New plug-in version (.2) uploaded. Still waiting for Yathosho to check his button issue is fixed though (but I can't seem to reproduce so perhaps it is fixed).
Fair number of changes/fixes: Quote:
Edit: Oh and I changed the button property names to _StuAeroWndProc_ ![]() |
|
![]() |
![]() |
![]() |
#21 |
Senior Member
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
|
Feedback for others:
![]() Chinese charactor didn't display when using this plug-in. Contact me: 137729898@qq.com |
![]() |
![]() |
![]() |
#22 |
Major Dude
|
@jiake: Did you use Unicode NSIS?
I assume ANSI NSIS cannot display them correctly. Cool looking installers with custom design: www.graphical-installer.com Create Setup Pages easily: www.install-designer.com Build installers in Visual Studio 2005-2019: www.visual-installer.com or RAD Studio 2009, 2010, XE-10.4 Sydney: www.rad-installer.com |
![]() |
![]() |
![]() |
#23 |
Senior Member
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
|
I have not used the plugin yet, for I am still using Windows XP.
The problem was found by other person, he lets me to feedback. Contact me: 137729898@qq.com |
![]() |
![]() |
![]() |
#24 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Currently using MultiByteToWideChar in the ANSI plug-in (DrawThemeTextEx is Unicode only) so this is likely the problem. I will change the code to avoid it when I have time (i.e. call GetWindowTextW).
Stu |
![]() |
![]() |
![]() |
#25 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
New version uploaded which should fix your Chinese characters bug (I hope).
Quote:
|
|
![]() |
![]() |
![]() |
#26 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
New version:
Quote:
Stu |
|
![]() |
![]() |
![]() |
#27 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
no longer got that problem with the latest build
|
![]() |
![]() |
![]() |
#28 |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
did anybody say transparency?
|
![]() |
![]() |
![]() |
#29 |
Major Dude
|
@Yathosho: MUI2 contains two dialogs: outer [which is transparent] and inner dialog [that grey area]
There is probably som problem with inner dialog transparency... Cool looking installers with custom design: www.graphical-installer.com Create Setup Pages easily: www.install-designer.com Build installers in Visual Studio 2005-2019: www.visual-installer.com or RAD Studio 2009, 2010, XE-10.4 Sydney: www.rad-installer.com |
![]() |
![]() |
![]() |
#30 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'm not sure what you are trying to do but you can't mix Aero with Windows controls without owner drawing them. I had to draw the navigation buttons myself to fix the transparency issue (and it still wasn't perfect until the last release). The problem is that the transparency key is black (and it has to be) and so all black objects (text etc.) will be rendered transparent.
Stu |
![]() |
![]() |
![]() |
#31 | |
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
Quote:
code: |
|
![]() |
![]() |
![]() |
#32 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Just noticed this plug-in. Great stuff. Thanks for sharing
![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#33 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I haven't experienced any crashes. Please can you post a script which reproduces the problem.
Edit: and what is the minimize and bring to front for? Stu |
![]() |
![]() |
![]() |
#34 |
Junior Member
Join Date: Jan 2010
Posts: 39
|
Branding text on WelcomeFinish page
First of all I would like to give you a big
![]() And my question ![]() The branding text is displayed on WelcomeFinish page when Aero is activated; when Aero is deactivated, the branding text is hidden. I'm used to not have this branding text on the first and last page. Did you intend to have this branding text displayed while Aero is activated or it's a bug? Is there a way to not have it displayed on first&last page? Thanks Isawen ![]() |
![]() |
![]() |
![]() |
#35 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
At the moment the branding text is either drawn or it isn't. It's not a static text control, it is simply drawn where the original static text used to be. Because of this, MUI does not hide/show it. I will fix it when I have time.
Stu |
![]() |
![]() |
![]() |
#36 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,337
|
I'm guessing this fixes some kind of drawing bug...
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#37 | |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Quote:
|
|
![]() |
![]() |
![]() |
#38 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Is there any chance to have the branding text centered in "classic" UI?
![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
#39 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Possibly but keep in mind there's a hidden Back button there so even if I do centre it it won't be centred in between Cancel and Close. The original branding text isn't centred IIRC it just happens to fit nicely for classic UI (when you have all 3 buttons).
Edit: It is in fact but still only centred between the 3 buttons. Stu |
![]() |
![]() |
![]() |
#40 | |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Quote:
Thanks ![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|