Documentation and API Samples for drawing on Windows Aero Glass (DWM, GDI, GDI+) for all Win32 programmers

谁都会走 提交于 2019-11-27 03:28:33

This is a subset of my "Glass" bookmarks folder, the result of a lot of research / searching on this topic. I've found all of these useful for learning about glass and solving various problems drawing on it. Most of these include Delphi code, but I've noted where it's for another language.

Plain Glass links

  • Using translucent windows with Delphi: good introduction (from the very basics) for using Glass in Delphi forms
  • Custom drawing on glass: covers how to draw a bitmap or other image on a glass area of the window. Covers alpha channels etc too, good overview
  • Using glass in a VC++ project: covers turning glass on, drawing text, handling notifications etc - a good general introduction to how it works. A lot of the underlying details are handled by the VCL (eg the GlassFrame property and TForm internals look after a lot of this) but it's very useful to understand the basics of how it's implemented at an API level anyway
  • How to draw on the non-client area: this shows how to draw something like Office's toolbar in the title bar. .Net code, but translatable
  • Setting up a custom title bar: very detailed article about non-client-area drawing (in Delphi, so Delphi code). Followed up by part 2, which demonstrates completely taking over the entire window and mimicking the standard title bar yourself. These two articles will let you mimic Office and Chrome as you requested in the question
  • How to set up various VCL controls to work best on a glass area: the VCL does not support glass very well. You'll often get artifacts, or controls simply not drawing properly at all, no matter what you do to try and solve it. This article lists the basic VCL visual components (labels, buttons, progress bars, etc) and what to set up for each so they draw perfectly, or at least 'as well as possible' when they're placed on a glass area

Advanced, or tangentially related:

Uli Gerhardt

These posts on drawing a custom title bar under Vista/Windows 7 might interest you.

Sample image:

I'm sure you've found the MSDN page about the DWM. It has jumps many topics and a few examples. Some of the "overview" articles there have examples (like the DWM Blur Behind Overview).

Unfortunately, other than the documentation, there are precious few good articles. You can start with Using glass on codeproject, and take a look at a detecting glass in delphi - after that using the functions straight from the docs is not too bad. Luckily they are all pretty straight-forward in practice.

Good web site for glass components, including a Glass button:

http://rmklever.com/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!