From: nethack.allison Date: Sun, 23 Mar 2003 19:16:54 +0000 (+0000) Subject: More (from ) X-Git-Tag: MOVE2GIT~2062 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34272b3249f244713d28aeafee0251e4e60f05c2;p=nethack More (from ) --- diff --git a/win/win32/mhsplash.c b/win/win32/mhsplash.c index 4f4ed2677..3a483d26e 100644 --- a/win/win32/mhsplash.c +++ b/win/win32/mhsplash.c @@ -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), diff --git a/win/win32/winhack.rc b/win/win32/winhack.rc index 32d210a57..ed2a4c42c 100644 --- a/win/win32/winhack.rc +++ b/win/win32/winhack.rc @@ -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