Tabs in title bar: what's the secret?

Qwertie picture Qwertie · Apr 5, 2011 · Viewed 10.5k times · Source

Chrome and Firefox 4, among other applications, now put some of their user interface in the title bar. In Windows, the OS normally controls the entire title bar. An application can create a custom title bar by removing the OS title bar and drawing a "fake" title bar instead (like WinAmp), but only the OS knows how to draw the non-customized elements of the title bar (e.g. Close/Minimize/Maximize), which vary by OS version.

By what mechanism do apps like Chrome and Firefox "share" the title bar with the OS (put custom elements in the title bar while keeping the original OS visual theme)?

enter image description here

In Chrome, the tabs encroach upon the title bar so that there is not enough space for title text.

Answer

Mark Ransom picture Mark Ransom · Apr 7, 2011

Microsoft has a very detailed explanation in the article Custom Window Frame Using DWM.