Windows: conditionally set tray icon state
[openafs.git] / src / WINNT / client_config / tab_general.cpp
index 3fe83ef..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)
       {
@@ -681,13 +684,11 @@ BOOL fIsCellInCellServDB (LPCTSTR pszCell)
            fFound = TRUE;
        CSDB_FreeFile (&CellServDB);
    }
-#ifdef AFS_AFSDB_ENV
-    if ( fFound == FALSE ) {
-        int ttl;
-        fFound = !cm_SearchCellByDNS(cellname, NULL, &ttl, NULL, NULL);
-    }
-#endif
-     done:
+   if ( fFound == FALSE ) {
+       int ttl;
+       fFound = !cm_SearchCellByDNS(cellname, NULL, &ttl, NULL, NULL);
+   }
+   done:
 
    return fFound;
 }