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
14 #include <afs/param.h>
23 * ROUTINES ___________________________________________________________________
27 void ChangeTrayIcon (int nim
)
29 static BOOL fAdded
= FALSE
;
30 static BOOL fDeleted
= FALSE
;
31 if ((nim
== NIM_MODIFY
) && (!fAdded
))
33 if ((nim
== NIM_MODIFY
) && (fDeleted
))
36 if ((nim
!= NIM_DELETE
) || (IsWindow (g
.hMain
)))
38 static HICON ICON_CREDS_YES
= TaLocale_LoadIcon (IDI_CREDS_YES
);
39 static HICON ICON_CREDS_NO
= TaLocale_LoadIcon (IDI_CREDS_NO
);
41 size_t iExpired
= Main_FindExpiredCreds();
44 memset (&nid
, 0x00, sizeof(NOTIFYICONDATA
));
45 nid
.cbSize
= sizeof(NOTIFYICONDATA
);
48 nid
.uFlags
= NIF_ICON
| NIF_MESSAGE
| NIF_TIP
;
49 nid
.uCallbackMessage
= WM_TRAYICON
;
50 lock_ObtainMutex(&g
.credsLock
);
51 nid
.hIcon
= ((g
.cCreds
!= 0) && (iExpired
== (size_t)-1)) ? ICON_CREDS_YES
: ICON_CREDS_NO
;
52 lock_ReleaseMutex(&g
.credsLock
);
53 GetString (nid
.szTip
, (g
.fIsWinNT
) ? IDS_TOOLTIP
: IDS_TOOLTIP_95
);
54 Shell_NotifyIcon (nim
, &nid
);
59 if (nim
== NIM_DELETE
)