From Yitzhak
(2 troublesome bands removed and will follow later) Here's the new patch with the Windows improvements; this should apply to the 3.4.2 tree. Note the changed filename in the diff lines. What's in it: > some MessageBox tidbits: > - Let all MessageBoxes display an icon > - Introduced NHMessageBox to have messageboxes display a consistent title > - Change icon in mswin_display_file from MB_ICONERROR to MB_ICONEXCLAMATION > for non-fatal error > > And to solve #U355: NetHackW won't run on Win2K OS: > - Avoid a crash when closing the main window while the splash screen is > displayed. > - Make sure NetHack starts normal when closed minimized > - Center the splash screen on the screen, not on the parent window (which may > be off-screen) What's new in it: - Show copyright banner in textbox in splash screen instead of over the picture - Show news in splash screen only if iflags.news (solves W341-6) - show complete version information in splash screen when it is used as about box
This commit is contained in:
+11
-4
@@ -438,7 +438,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
|
||||
wp.length = sizeof(wp);
|
||||
if (GetWindowPlacement(hWnd, &wp)) {
|
||||
GetNHApp()->regMainShowState = wp.showCmd;
|
||||
GetNHApp()->regMainShowState = (wp.showCmd == SW_SHOWMAXIMIZED
|
||||
? SW_SHOWMAXIMIZED : SW_SHOWNORMAL);
|
||||
|
||||
GetNHApp()->regMainMinX = wp.ptMinPosition.x;
|
||||
GetNHApp()->regMainMinY = wp.ptMinPosition.y;
|
||||
@@ -472,9 +473,15 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||
NHEVENT_KBD('\033'); /* and send keyboard input as if user pressed ESC */
|
||||
/* additional code for this is done in menu and rip windows */
|
||||
}
|
||||
else if (!program_state.something_worth_saving)
|
||||
{
|
||||
/* User exited before the game started, e.g. during splash display */
|
||||
/* Just get out. */
|
||||
bail((char *)0);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(MessageBox(hWnd, TEXT("Save?"), TEXT("NetHack for Windows"), MB_YESNOCANCEL | MB_ICONQUESTION)) {
|
||||
switch (NHMessageBox(hWnd, TEXT("Save?"), MB_YESNOCANCEL | MB_ICONQUESTION)) {
|
||||
case IDYES: NHEVENT_KBD('y'); dosave(); break;
|
||||
case IDNO: NHEVENT_KBD('q'); done(QUIT); break;
|
||||
case IDCANCEL: break;
|
||||
@@ -761,9 +768,9 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
mswin_destroy_reg();
|
||||
/* Notify the user that windows settings will not be saved this time. */
|
||||
MessageBox(GetNHApp()->hMainWnd,
|
||||
NHMessageBox(GetNHApp()->hMainWnd,
|
||||
"Your Windows Settings will not be stored when you exit this time.",
|
||||
"NetHack", MB_OK | MB_ICONINFORMATION);
|
||||
MB_OK | MB_ICONINFORMATION);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user