How do I create a window with different Aero glass frame?
Asked Answered
F

2

12

I think there is a customized window style in Windows 7. like this :

enter image description here enter image description here

And as you can see it's different from normal style :

enter image description here

How can i create a window with the style that you can see in the first picture ?

Fatuous answered 23/6, 2011 at 13:5 Comment(2)
I expect you are going to need DwmExtendFrameIntoClientArea and some custom painting. I've no experience of this myself (as is well documented, I'm a plain vanilla kind of guy). This well known article covers non-client painting on glass: delphihaven.wordpress.com/2010/04/19/…Ellis
What are you asking for? Do you mean that the Windows theme color is ignored and the window caption is not transparent?Phinney
S
8

What Delphi version? Delphi 2010 can do this natively:

enter image description here

You just have to play with the GlassFrame property of the form. You might also want to read my answer here, and make sure you also read the comments: Delphi support for Aero Glass and the DoubleBuffered property - what is going on and how do we use them?

Stupor answered 23/6, 2011 at 14:34 Comment(4)
@Kermia, if you're talking about my "Delphi 2010 can do this natively" image, there's no code behind it: It's just a form on Delphi 2010 with GlassFrame.Enabled = True and GlassFrame.Top = 120.Stupor
@Johan, anti-aliased text and color-keying don't work well together, not to mention the color-key is black. For The Brave, I'm guessing the proper way to do this is using UpdateLayeredWindow, but I've once been there and it's a world of pain. Because layered windows don't like user input.Stupor
Oh OK . Is it possible to set a shadow for controls that placed in glass-frameed window ?Fatuous
No, there's no automatic way to give controls a shadow; But you could place a shadow-like semi-transparent image behind the control to simulate that.Stupor
A
5

those things are done with glass composition color.

take a look here: Changing the glass composition color (DWM) using delphi

Anglophobe answered 23/6, 2011 at 14:25 Comment(2)
I was in the middle of typing something similar. <g> You're just a little faster. +1. You might want to edit to mention that in D2009-XE you can just click on the form and then set the GlassFrame.Enabled property to true in the Object Inspector to achieve much of this immediately.Nevsa
Beware, the undocumented DWM function mentioned in the blog post changes the composition color system wide and persistently. It stays changed even after a reboot!Stupor

© 2022 - 2024 — McMap. All rights reserved.