diff --git a/windows/version.rc2 b/windows/version.rc2
index 120d158..829c4fd 100644
--- a/windows/version.rc2
+++ b/windows/version.rc2
@@ -82,6 +82,7 @@
 /*
  * The actual VERSIONINFO resource.
  */
+#pragma code_page(1252)
 VS_VERSION_INFO VERSIONINFO
 /* (None of this "fixed" info appears to be trivially user-visible on
  * Win98SE. The binary version does show up on Win2K.) */
@@ -128,6 +129,7 @@ BEGIN
 	VALUE "Translation", 0x809, 1200
     END
 END
+#pragma code_page(DEFAULT)
 
 #undef VERSION_TEXT
 #undef BASE_VERSION
diff --git a/windows/window.c b/windows/window.c
index 7831331..5da9f7d 100644
--- a/windows/window.c
+++ b/windows/window.c
@@ -36,6 +36,8 @@
 /* #define XTRANS_AVOID_UL_BUG */
 /* < */
 
+static void end_paint_buffer(HPAINTBUFFER hpb);
+
 /* From MSDN: In the WM_SYSCOMMAND message, the four low-order bits of
  * wParam are used by Windows, and should be masked off, so we shouldn't
  * attempt to store information in them. Hence all these identifiers have
@@ -2988,6 +2990,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
       case WM_PAINT:
 	{
 	    PAINTSTRUCT p;
+            HPAINTBUFFER hpb = NULL;
 
 	    HideCaret(hwnd);
 	    hdc = BeginPaint(hwnd, &p);
@@ -2995,6 +2998,15 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
 		SelectPalette(hdc, pal, TRUE);
 		RealizePalette(hdc);
 	    }
+            if (cfg.transparent_mode == 4) {
+                HDC hdcMem;
+                BP_PAINTPARAMS pp = {sizeof pp};
+                pp.dwFlags = BPPF_ERASE;
+                hpb = BeginBufferedPaint(p.hdc, &p.rcPaint, BPBF_TOPDOWNDIB, &pp, &hdcMem);
+                if (hpb != NULL) {
+                    hdc = hdcMem;
+                }
+            }
 
 	    /*
 	     * We have to be careful about term_paint(). It will
@@ -3085,6 +3097,9 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
 	    }
 	    SelectObject(hdc, GetStockObject(SYSTEM_FONT));
 	    SelectObject(hdc, GetStockObject(WHITE_PEN));
+            if (hpb != NULL) {
+                end_paint_buffer(hpb);
+            }
 	    EndPaint(hwnd, &p);
 	    ShowCaret(hwnd);
 	}
@@ -5236,13 +5251,30 @@ void set_sbar(void *frontend, int total, int start, int page)
 	SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
 }
 
+static HPAINTBUFFER hpbContext = NULL;
+
 Context get_ctx(void *frontend)
 {
     HDC hdc;
     if (hwnd) {
+        BOOL bEnabled = FALSE;
+
 	hdc = GetDC(hwnd);
 	if (hdc && pal)
 	    SelectPalette(hdc, pal, FALSE);
+
+        DwmIsCompositionEnabled(&bEnabled);
+        if (bEnabled) {
+            HDC hdcMem = NULL;
+            RECT rc;
+            BP_PAINTPARAMS pp = {sizeof pp};
+            GetClientRect(hwnd, &rc);
+            hpbContext = BeginBufferedPaint(hdc, &rc, BPBF_TOPDOWNDIB, &pp, &hdcMem);
+            if (hpbContext != NULL) {
+                BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, hdc, 0, 0, SRCCOPY);
+                hdc = hdcMem;
+            }
+        }
 	return hdc;
     } else
 	return NULL;
@@ -5250,10 +5282,19 @@ Context get_ctx(void *frontend)
 
 void free_ctx(Context ctx)
 {
+    if (hpbContext != NULL) {
+        end_paint_buffer(hpbContext);
+    }
     SelectPalette(ctx, GetStockObject(DEFAULT_PALETTE), FALSE);
     ReleaseDC(hwnd, ctx);
 }
 
+static void end_paint_buffer(HPAINTBUFFER hpb)
+{
+    BufferedPaintSetAlpha(hpb, NULL, (BYTE)cfg.shading);
+    EndBufferedPaint(hpb, TRUE);
+}
+
 static void real_palette_set(int n, int r, int g, int b)
 {
     if (pal) {
@@ -6353,29 +6394,9 @@ static void
 extend_glass_frame(HWND hwnd)
 {
     BOOL bEnabled = FALSE;
-    HRESULT (WINAPI *pDwmIsCompositionEnabled)(BOOL*) = NULL;
-    HRESULT (WINAPI *pDwmExtendFrameIntoClientArea)(HWND, MARGINS*) = NULL;
-    HMODULE hmDwmapi = NULL;
-
-    if (osVersion.dwMajorVersion < 6) {
-	return;
-    }
-
-    hmDwmapi = load_system32_dll("dwmapi.dll");
-
-    if (hmDwmapi) {
-	pDwmIsCompositionEnabled =
-	    GetProcAddress(hmDwmapi, "DwmIsCompositionEnabled");
-	pDwmExtendFrameIntoClientArea =
-	    GetProcAddress(hmDwmapi, "DwmExtendFrameIntoClientArea");
-    }
-    if (pDwmIsCompositionEnabled) {
-	pDwmIsCompositionEnabled(&bEnabled);
+    DwmIsCompositionEnabled(&bEnabled);
+    if (bEnabled) {
+        DWM_BLURBEHIND bb = {DWM_BB_ENABLE, TRUE};
+        DwmEnableBlurBehindWindow(hwnd, &bb);
     }
-    if (bEnabled && pDwmExtendFrameIntoClientArea) {
-	MARGINS margins = {-1, 0, 0, 0};
-	pDwmExtendFrameIntoClientArea(hwnd, &margins);
-    }
-
-    FreeLibrary(hmDwmapi);
 }
