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 ?

Frédéric Hamidi
  • 258,201
  • 41
  • 486
  • 479
Kermia
  • 4,171
  • 13
  • 64
  • 105
  • 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: http://delphihaven.wordpress.com/2010/04/19/setting-up-a-custom-titlebar/ – David Heffernan Jun 23 '11 at 13:17
  • What are you asking for? Do you mean that the Windows theme color is ignored and the window caption is not transparent? – splash Jun 23 '11 at 14:45

2 Answers2

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?

Community
  • 1
  • 1
Cosmin Prund
  • 25,498
  • 2
  • 60
  • 104
  • @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`. – Cosmin Prund Jun 23 '11 at 15:20
  • @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](http://msdn.microsoft.com/en-us/library/ms633556(v=vs.85).aspx), but I've once been there and it's a world of pain. Because layered windows don't like user input. – Cosmin Prund Jun 23 '11 at 15:24
  • Oh OK . Is it possible to set a shadow for controls that placed in glass-frameed window ? – Kermia Jun 23 '11 at 15:25
  • 2
    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. – Cosmin Prund Jun 23 '11 at 15:28
5

those things are done with glass composition color.

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

coding Bott
  • 4,287
  • 1
  • 27
  • 44
  • 3
    I was in the middle of typing something similar. 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. – Ken White Jun 23 '11 at 14:33
  • 2
    **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! – Cosmin Prund Jun 23 '11 at 15:19