2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 #include <afs/param.h>
20 * ROUTINES ___________________________________________________________________
24 void ChangeTrayIcon (int nim)
26 static BOOL fAdded = FALSE;
27 static BOOL fDeleted = FALSE;
28 if ((nim == NIM_MODIFY) && (!fAdded))
30 if ((nim == NIM_MODIFY) && (fDeleted))
33 if ((nim != NIM_DELETE) || (IsWindow (g.hMain)))
35 static HICON ICON_CREDS_YES = TaLocale_LoadIcon (IDI_CREDS_YES);
36 static HICON ICON_CREDS_NO = TaLocale_LoadIcon (IDI_CREDS_NO);
38 size_t iExpired = Main_FindExpiredCreds();
41 memset (&nid, 0x00, sizeof(NOTIFYICONDATA));
42 nid.cbSize = sizeof(NOTIFYICONDATA);
45 nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
46 nid.uCallbackMessage = WM_TRAYICON;
47 lock_ObtainMutex(&g.credsLock);
48 nid.hIcon = ((g.cCreds != 0) && (iExpired == (size_t)-1)) ? ICON_CREDS_YES : ICON_CREDS_NO;
49 lock_ReleaseMutex(&g.credsLock);
50 GetString (nid.szTip, (g.fIsWinNT) ? IDS_TOOLTIP : IDS_TOOLTIP_95);
51 Shell_NotifyIcon (nim, &nid);
56 if (nim == NIM_DELETE)