Michael Bruestle (michael_bruestle@yahoo.com)
[reactos.git] / reactos / lib / sdk / scrnsave / scrnsave.c
index 8438587..8538145 100644 (file)
@@ -174,8 +174,8 @@ static int LaunchScreenSaver(HWND hParent)
     else
     {
         style = WS_POPUP;
-        rc.right = GetSystemMetrics(SM_CXSCREEN);
-        rc.bottom = GetSystemMetrics(SM_CYSCREEN);
+        rc.right = GetSystemMetrics(SM_CXVIRTUALSCREEN);
+        rc.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN);
         style |= WS_VISIBLE;
     }
 
@@ -185,15 +185,16 @@ static int LaunchScreenSaver(HWND hParent)
                                  0, 0, rc.right, rc.bottom, hParent, NULL,
                                  hMainInstance, NULL);
 
+    if(!hMainWindow)
+        return 1;
+
     // Display window and start pumping messages
-    if (hMainWindow)
-    {
-        ShowWindow(hMainWindow, SW_SHOW);
+    ShowWindow(hMainWindow, SW_SHOW);
+    if (!hParent)
         SetCursor(NULL);
 
-        while (GetMessage(&msg, NULL, 0, 0))
-            DispatchMessage(&msg);
-    }
+    while (GetMessage(&msg, NULL, 0, 0))
+        DispatchMessage(&msg);
 
     return msg.wParam;
 }
@@ -203,6 +204,9 @@ int APIENTRY _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR CmdLine, int
 {
     LPTSTR p;
 
+       UNREFERENCED_PARAMETER(nCmdShow);
+       UNREFERENCED_PARAMETER(hPrevInst);
+
     hMainInstance = hInst;
 
     // Parse the arguments