]> granicus.if.org Git - nethack/commitdiff
More (from <Someone>)
authornethack.allison <nethack.allison>
Sun, 23 Mar 2003 19:16:54 +0000 (19:16 +0000)
committernethack.allison <nethack.allison>
Sun, 23 Mar 2003 19:16:54 +0000 (19:16 +0000)
win/win32/mhsplash.c
win/win32/winhack.rc

index 4f4ed2677708550bc98ff69f6da04b3a371b7199..3a483d26e928dccc7a163a66b5f50c2cb7627238 100644 (file)
@@ -31,12 +31,13 @@ extern HFONT extrainfo_splash_font;
 void mswin_display_splash_window (BOOL show_ver)
 {
        MSG msg;
      RECT rt;
int left, top;
        RECT splashrt;
        RECT clientrt;
        RECT controlrt;
        HWND hWnd;
  int buttop;
+ HDC hDC;
 
        hWnd = CreateDialog(GetNHApp()->hApp, MAKEINTRESOURCE(IDD_SPLASH),
            GetNHApp()->hMainWnd, NHSplashWndProc);
@@ -57,10 +58,12 @@ void mswin_display_splash_window (BOOL show_ver)
        splashrt.right += SPLASH_WIDTH + SPLASH_OFFSET_X * 2 - clientrt.right;
        splashrt.bottom += SPLASH_HEIGHT + controlrt.bottom + SPLASH_OFFSET_Y * 3 - clientrt.bottom;
        /* Place the window centered */
-       GetWindowRect(GetNHApp()->hMainWnd, &rt);
-       rt.left += (rt.right - rt.left - splashrt.right) / 2;
-       rt.top += (rt.bottom - rt.top - splashrt.bottom) / 2;
-       MoveWindow(hWnd, rt.left, rt.top, splashrt.right, splashrt.bottom, TRUE);
+ /* On the screen, not on the parent window */
+ hDC = CreateDC("DISPLAY", NULL, NULL, NULL);
+ left = (GetDeviceCaps(hDC, HORZRES) - splashrt.right) / 2;
+ top = (GetDeviceCaps(hDC, VERTRES) - splashrt.bottom) / 2;
+ DeleteDC(hDC);                          
+ MoveWindow(hWnd, left, top, splashrt.right, splashrt.bottom, TRUE);
  /* Place the OK control */
        GetClientRect (hWnd, &clientrt);
        MoveWindow (GetDlgItem(hWnd, IDOK),
index 32d210a57f5f6d9930fb92a0d3ce82f7f165501b..ed2a4c42cc760cc74e37ab75d2c522343614f672 100644 (file)
@@ -325,6 +325,7 @@ STRINGTABLE DISCARDABLE
 BEGIN
     IDS_APP_TITLE           "NetHack for Windows - Graphical Interface"
     IDC_NETHACKW            "NETHACKW"
+    IDS_APP_TITLE_SHORT     "NetHack for Windows"
 END
 
 #endif    // English (U.S.) resources