Add some spare SetForegroundWindow and SetActiveWindow calls to try
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 19 May 2001 15:23:12 +0000 (15:23 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 19 May 2001 15:23:12 +0000 (15:23 +0000)
to improve window behaviour. Also make the About box a subdialog of
the config box instead of a separate child of the root.

git-svn-id: svn://svn.tartarus.org/sgt/putty@1139 cda61777-01e9-0310-a592-d414129be87e

windlg.c
window.c

index 1e5a632..793bb08 100644 (file)
--- a/windlg.c
+++ b/windlg.c
@@ -2426,8 +2426,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg,
     }
     if (msg == WM_COMMAND && LOWORD(wParam) == IDCX_ABOUT) {
        EnableWindow(hwnd, 0);
-       DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX),
-                 GetParent(hwnd), AboutProc);
+       DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProc);
        EnableWindow(hwnd, 1);
        SetActiveWindow(hwnd);
     }
@@ -2452,6 +2451,7 @@ void defuse_showwindow(void)
        hwnd = CreateDialog(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX),
                            NULL, NullDlgProc);
        ShowWindow(hwnd, SW_HIDE);
+       SetActiveWindow(hwnd);
        DestroyWindow(hwnd);
     }
 }
index 9948763..546a917 100644 (file)
--- a/window.c
+++ b/window.c
@@ -574,6 +574,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
      * Finally show the window!
      */
     ShowWindow(hwnd, show);
+    SetForegroundWindow(hwnd);
 
     /*
      * Open the initial log file if there is one.