The khm_show_main_window() function is no longer called
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 14 Nov 2007 22:34:53 +0000 (22:34 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 14 Nov 2007 22:34:53 +0000 (22:34 +0000)
at startup with khm_nCmdShow == SW_SHOWMINIMIZED in order to
hide the main application by calling khm_hide_main_window().
Instead, the main application window is simply never shown.

As a result, khm_show_main_window() needs to respond to
khm_nCmdShow == SW_SHOWMINIMIZED not by hiding the window
but by changing the khm_nCmdShow state to SW_SHOW and then
calling ShowWindow().

This change will address the problem whereby "Show NIM Window"
had to be triggered twice by the user when the process
was started in a minimized state.

ticket: 5842

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20164 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/identity/ui/mainwnd.c

index 42fcd193c39675961f7b3b3143fb7a32545041a1..6802cd25702713cd292d1de4c3f07b4a1a919f17 100644 (file)
@@ -1212,18 +1212,29 @@ khm_show_main_window(void) {
         if (hw != khm_hwnd_main)
             SetForegroundWindow(khm_hwnd_main);
     }
-
-    if (khm_nCmdShow == SW_SHOWMINIMIZED ||
+    /*
+     * We test for the values of khm_nCmdShow that
+     * can be set at process startup.  They will 
+     * only be seen the first time this function is 
+     * called.  After the first time, the value of
+     * khm_nCmdShow will always be SW_RESTORE.
+     * When one of the minimized values is set, 
+     * khm_show_main_window() will not be called
+     * unless the user initiates a request to show
+     * the window.
+     */
+    else if (khm_nCmdShow == SW_SHOWMINIMIZED ||
         khm_nCmdShow == SW_SHOWMINNOACTIVE ||
         khm_nCmdShow == SW_MINIMIZE) {
-        khm_hide_main_window();
-    } else {
-        ShowWindow(khm_hwnd_main, khm_nCmdShow);
-        UpdateWindow(khm_hwnd_main);
 
-        khm_cred_refresh();
+        khm_nCmdShow = SW_SHOW;
     }
 
+    ShowWindow(khm_hwnd_main, khm_nCmdShow);
+    UpdateWindow(khm_hwnd_main);
+    
+    khm_cred_refresh();
+
     khm_nCmdShow = SW_RESTORE;
 }