[csrss]
[reactos.git] / reactos / subsystems / win32 / csrss / win32csr / desktopbg.c
index ed17c22..ea6b0ca 100644 (file)
@@ -42,23 +42,19 @@ static HWND VisibleDesktopWindow = NULL;
 static LRESULT CALLBACK
 DtbgWindowProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
-  switch(Msg)
+  PAINTSTRUCT PS;
+  HDC hDC;
+
+    switch(Msg)
     {
       case WM_ERASEBKGND:
+        PaintDesktop((HDC)wParam);
         return 1;
 
       case WM_PAINT:
       {
-        PAINTSTRUCT PS;
-        RECT rc;
-        HDC hDC;
-
-        if(GetUpdateRect(Wnd, &rc, FALSE) &&
-           (hDC = BeginPaint(Wnd, &PS)))
-        {
-          PaintDesktop(hDC);
+        if((hDC = BeginPaint(Wnd, &PS)))
           EndPaint(Wnd, &PS);
-        }
         return 0;
       }
 
@@ -71,6 +67,9 @@ DtbgWindowProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
       case WM_CREATE:
         return 0;
 
+      case WM_CLOSE:
+        return 0;
+
       case WM_NOTIFY:
       {
         PPRIVATE_NOTIFY_DESKTOP nmh = (PPRIVATE_NOTIFY_DESKTOP)lParam;