Announcement

Collapse
No announcement yet.

Aero plug-in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aero plug-in



    Enables Windows Aero glass effect on NSIS (outer) UI.



    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
    Looks very nice indeed, thanks for sharing!

    Comment


    • #3
      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-2022: www.visual-installer.com
      or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com

      Comment


      • #4
        nice plug-in, thank you very much!

        Comment


        • #5
          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

          Comment


          • #6
            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

            Comment


            • #7
              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

              Comment


              • #8
                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

                Comment


                • #9
                  Originally Posted by Anders View Post
                  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?
                  1. I've tested on Vista and it seems to work OK. Maybe I shouldn't bother though and just go with the black brush method. Both methods are written about by Microsoft developers though IIRC.

                  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

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      So is that how your plug-in does the buttons too or does it owner-draw them?

                      Stu

                      Comment


                      • #12
                        Originally Posted by Afrow UK View Post
                        So is that how your plug-in does the buttons too or does it owner-draw them?
                        I use subclassing and WM_PRINT?CLIENT? like you do, but I use one of the GetThemeBackgroundSomething functions to calculate the area to mask off for the round corners.

                        I was going to look into adding the animation back but got bored and stopped working on the plugin...
                        IntOp $PostCount $PostCount + 1

                        Comment


                        • #13
                          Is it GetThemeBackgroundRegion? How would that be used with BufferedPaintSetAlpha which requires a RECT?

                          Stu

                          Comment


                          • #14
                            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

                            Comment


                            • #15
                              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

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎