Windows: conditionally set tray icon state
[openafs.git] / src / WINNT / client_config / tab_general.cpp
index f97caf7..4994c2b 100644 (file)
@@ -11,7 +11,9 @@
 #include <ws2tcpip.h>
 
 extern "C" {
+#include <afsconfig.h>
 #include <afs/param.h>
+#include <roken.h>
 #include <afs/stds.h>
 #include <afs/cm.h>
 #include <rx/rxkad.h>
@@ -266,11 +268,12 @@ BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid)
    BOOL fLogonAuthent = IsDlgButtonChecked (hDlg, IDC_LOGON);
    if (fLogonAuthent != g.Configuration.fLogonAuthent)
       {
-          SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED);
+      SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED);
       g.Configuration.fLogonAuthent = fLogonAuthent;
       }
 
-   Config_SetTrayIconFlag (IsDlgButtonChecked (hDlg, IDC_TRAYICON));
+  if (GetDlgItem(hDlg, IDC_TRAYICON) != NULL)
+      Config_SetTrayIconFlag (IsDlgButtonChecked(hDlg, IDC_TRAYICON));
 
    if (g.fIsWinNT)
       {