Thema: Delphi Remove Vista Aero Border

Einzelnen Beitrag anzeigen

astral2k5

Registriert seit: 14. Feb 2007
2 Beiträge
 
Delphi 7 Professional
 
#1

Remove Vista Aero Border

  Alt 17. Feb 2007, 10:35
Hi,

Sorry for posting in English.

I'm trying to remove the "big" border that Vista AERO and Basic Theme have around a window.

According to this blog post :
http://shellrevealed.com/blogs/shell...dow-frame.aspx

Zitat:
What's with the extra border?
You will notice in the anatomy picture above an extra iPaddedBorderWidth padding, that wasn't there in XP. That's the glass border (4 pixels by default), upon which the Aero look is based.
This metric is new and different from the pre-existing border metric (iBorderWidth, 1 pixel by default):

iBorderWidth is used in a lot of places other than the window frame, like splitter windows and many surprising places. So if we increased it, you would have seen extra fat splitters, and other undesirable effects.
Contrary to iBorderWidth, iPaddedBorderWidth affects both resizable (thick) and non-resizable (thin) frames (so it makes thin frames not-so-thin anymore, which was desired for glass).
In a nutshell:

thick frame padding = iBorderWidth + iPaddedBorderWidth
thin frame padding = 1 + iPaddedBorderWidth

So even in Aero, if you like thick borders but not for non-resizable windows, you can set the padded border to 0 and increase the "Active Window Border" instead; you'll get thick glass borders, but in less places (although you'll get the side effects of thick splitters, etc.).
So here is my question, how can I set padded border to 0 using Delphi or someway to remove the "extra" vista border?

Also, in the comments of the same blog post I've found this :

Zitat:
You can explicitely disable the glass frame for a given window with DwmSetWindowAttribute(DWMWA_NCRENDERING_POLICY) and DWMNCRP_DISABLED.
DwmSetWindowAttribute on MSDN comes with the example below :
http://msdn.microsoft.com/library/de...wattribute.asp

Code:
 HRESULT DisableNCRendering(HWND hwnd)

   HRESULT hr = S_OK;

   DWMNCRENDERINGPOLICY ncrp = DWMNCRP_DISABLED;

   // Disable non-client area rendering on window
   hr = DwmSetWindowAttribute(hwnd, DWMWA_NCRENDERING_POLICY, &ncrp, sizeof(ncrp));
   if (SUCCEEDED(hr))
   { 
      //do more stuff
   } 
   return hr;
}
Could this function remove the padding border ? or only the glass effect ?

Please let me know your ideas.

P.S. :
According to this MSDN page :
http://msdn2.microsoft.com/en-us/library/ms724506.aspx

NONCLIENTMETRICS struct has this new member :
int iPaddedBorderWidth;

Thanks.