Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

Aero Glass for Win8 RC4

Recommended Posts


Since I am busy with studying DWM and trying to introduce some more interesting stuff which will take a longer time implement (if it is possible :-) ) but I don't want to let you wait too long, here is another preview. Do not expect too much from this version. Just a few fixed bugs (and new bugs added :-) )

What's new:

* removed dependency on C:\DWM folder

* loop for layered windows chained into DWM main window's timer

* set lower interval for setting layered windows

* fixed crash for application which do not like WS_EX_LAYERED to be set too early (e.g. Windows Paint)

* fixed a few memory leaks

* added temporary workaround for iTunes (it will be removed in the future!!!)

* added some new EXPERIMENTAL registry settings:

HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\DWM (no user-specific settings now!)

DisableDebugLog (DWORD) = when set to 1, it disables logging to file. NOT RECOMMENDED!!!

ForceBoundingRectangleRedraw (DWORD) = when set to 1, layered windows technique will be disabled completely. Instead of it, it tries to repaint whole bounding rectangle of the window texture (with respect to clipping area). This settings is for users who don't like layered windows but I don't recommend to use it at all, because it has not been tested much, you won't see totally obscured objects in transparent area and it brings a lot of redraw glitches (so do not complain about them)!!!


When launched the loader everything was fine but after a few seconds the windows started to lag :(

Edited by Tusticles
Link to post
Share on other sites

And just a small thing for users who like coding in C++ and Direct2D/Direct3D and would like to play with a little code.

At the beginning of this project I was trying to implement transparency and blur effect via wndproc hooking and implementing my own WM_NCPAINT handler. It was working correctly but it was slow. There were many lags on window move and resize. I was using the following code to reach the transparency effect. The problem if this code is that is written using GDI library so it is slow and does not render any layered windows nor Direct3D content in transparent areas. Maybe it would be worth to reimplement it using Direct2D/Direct3D (maybe user32.dll: DwmGetDxSharedSurface could be used to get actual window content) and then try using in the project to achieve transparency without layered windows.

void OffscreenBuffer::update()
// since there is no easy way to access DWM Direct3D surface, we must render windows using GDI
// problem is that it does not render any Direct3D content (including DWM window border or layered windows)
gdiBitmapTarget->GetDC(D2D1_DC_INITIALIZE_MODE_COPY, &hDC);

auto winRegion = CreateRectRgn(wi.rcWindow.left - RADIUS, wi.rcWindow.top - RADIUS, wi.rcWindow.right + RADIUS, wi.rcWindow.bottom + RADIUS);
auto clientRegion = CreateRectRgn(wi.rcWindow.left + wi.cxWindowBorders + RADIUS, wi.rcWindow.top + wi.cyWindowBorders + RADIUS, wi.rcWindow.right - wi.cxWindowBorders - RADIUS, wi.rcWindow.bottom - wi.cxWindowBorders - RADIUS);

HRGN borderRegion = CreateRectRgn(0,0,0,0);
CombineRgn(borderRegion, winRegion, clientRegion, RGN_DIFF);

// iterate over all windows (starting with the current window) and render their content into off-screen bitmap
// only windows obsured by our window border are rendered
HWND next = hWnd;
while(next = GetNextWindow(next, GW_HWNDNEXT))
if(IsWindowVisible(next) &&
!((GetWindowLong(next, GWL_EXSTYLE) & WS_EX_LAYERED) == WS_EX_LAYERED)) // ignore layered windows for now
RECT wndRect = { 0 };
GetWindowRect(next, &wndRect);

if(RectInRegion(borderRegion, &wndRect)) // does window lie beneath our border?
HDC winDC = ::GetWindowDC(next);

// avoid drawing area which lies outside of the border
SelectClipRgn(winDC, borderRegion);
SelectClipRgn(hDC, borderRegion);

// blit the clipped region
BitBlt(hDC, wndRect.left, wndRect.top, wndRect.right - wndRect.left, wndRect.bottom - wndRect.top, winDC, 0, 0, SRCCOPY);

SelectClipRgn(winDC, NULL);
ReleaseDC(next, winDC);

// substract region of this window not to blit windows which are obscured by it
HRGN wndRgn = CreateRectRgnIndirect(&wndRect);
int currRgn = CombineRgn(borderRegion, borderRegion, wndRgn, RGN_DIFF);

// if we end up with empty region (i.e. all discovered windows already take whole border area),
// it makes no sense to continue, because all other windows wouldn't be visible at all
if(currRgn == NULLREGION)

SelectClipRgn(hDC, NULL);

RECT rc = { max(0, wi.rcWindow.left), max(0, wi.rcWindow.top), min(wi.rcWindow.right, 1920), min(wi.rcWindow.bottom, 1080) };

Just in case, anyone want to play...

Link to post
Share on other sites

bigmuscle, I found the problem, my gpu have clock profiles, in desktop the low clock profile is running and the windows are laggy.

Performance Level 0 (P12)

Memory Clock 135MHz

Shader Clock 101MHz

Performance Level 1 (P8)

Memory Clock 324MHz

Shader Clock 147MHz

Performance Level 2 (P1)

Memory Clock 1500MHz

Shader Clock 730MHz

Performance Level 3 (P0)

Memory Clock 1500MHz

Shader Clock 1240MHz

I have lag only with P12 and P8 profiles.


Fixed the issue by forcing a fixed clock, I chose P1 but these clocks in idle... idk.

Edited by Tusticles
Link to post
Share on other sites

Good news, this preview is even more stable than the previous one :)

On my computer, with ForceBoundingRectangleRedraw activated, some windows have a white title bar.

(Or an aero basic title bar, not skinned at all by DWM.)

So, after testing I disabled this setting ^^

I updated the customization GUI to fit the new preview :


Each GUI version should be used only with the correct preview.

This one is for preview 3, do not use it with preview 2.

Download link : AGTweaker-1.0.2.zip

Get the Sources : AGTweaker-1.0.2-Sources.zip

Sources are released under the CCDL license. (why ?)

Link to post
Share on other sites

Yeah, close animation seems to be disabled when layered window is activated. I have not found a way to get it back (except of hooking WM_CLOSE and call AnimateWindow on my own which is a bit ugly).

btw, anyone having problem with high CPU/GPU usage, please try that ForceBoundingRectangleRedraw settings. It will be bring some glitches into border painting (which is not important currently) but it let us know whether your problem is caused by blurring algorithm or by layered windows.

Link to post
Share on other sites

I have an other bug: if the blur is set to higher (like 70+), if you move the window, it makes artifacts if you move them trough other aero surfaces.

The higher the blur, the higher the effect is visible. I cant make scrennshot of it.

Oh and im sorry but I'd like to know is it normal ig the taskbar is not blurred, only the windows?

Link to post
Share on other sites

Unfortunately, this is normal, because blur algorithm requires some more extra pixels around to correctly blur edge pixels (the higher radius the more pixels is required). The problem is Win8 does not mark these extra pixels as dirty when some region changes so it blurs with wrong pixels around the edges :(

Link to post
Share on other sites

One bug is fixed for me in 0.3 with trillian, but Avion pro skin (which also use transparency) still crash and the crash log is the same but with other hex codes. And i have an idea to fix the task bar blur for me :D I'll blur my wallpaper there:DD

Link to post
Share on other sites

One bug is fixed for me in 0.3 with trillian, but Avion pro skin (which also use transparency) still crash and the crash log is the same but with other hex codes. And i have an idea to fix the task bar blur for me :D I'll blur my wallpaper there:DD

Try to disable taskbar transparency with this: http://hb860.deviantart.com/art/Opaque-Taskbar-for-Windows-8-347219169 It should enable Aero for it.

Link to post
Share on other sites


Just joined to say thanks and confirm that it worked for me.

Installed it on a completely fresh installation of W8Pro64 - fairly basic laptop with intel integrated grapics, core2 cpu etc - and it works just fine with your default settings. I got a couple of errors messages at first - but only because I copied the folder the C: drive without renaming it to DWN (7-Zip named it the same as the download itself) - my bad.

I've also tried it whilst using "Start8" (stardock's start menu add-on) and it works fine - tried with all combinations of transparency of the task bar and "start menu" and no problems. Tried with automatic coloured title bars and changing wallpapers every ten seconds - worked perfectly. Tried different font sizes in title-bars and everything I could thing to mess it up - but it worked just fine. No problems noticed with "metro". No problems noticed with any running apps or desktop programs that I've tried - no problems with Media Centre.

I got no major increase in CPU usage, no noticeable shortening of battery life.

Subjectively - I messed around with the transparency/blur values (worth mentioning that you need to stop and restart the "test" each time to see the change) - I reckon your defaults are well chosen for the flat "surface" of the W8 title-bars.

Lastly - thanks and respect - really looking forward to the finished version.

Link to post
Share on other sites
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...