| 9682 | } |
| 9683 | |
| 9684 | void Script::ShowTrayIcon(bool aShow) |
| 9685 | { |
| 9686 | if (g_NoTrayIcon = !aShow) // Assign. |
| 9687 | { |
| 9688 | if (mNIC.hWnd) // Since it exists, destroy it. |
| 9689 | { |
| 9690 | Shell_NotifyIcon(NIM_DELETE, &mNIC); // Remove it. |
| 9691 | mNIC.hWnd = NULL; // Set this as an indicator that tray icon is not installed. |
| 9692 | // but don't do DestroyMenu() on mTrayMenu->mMenu (if non-NULL) since it may have been |
| 9693 | // changed by the user to have the custom items on top of the standard items, |
| 9694 | // for example, and we don't want to lose that ordering in case the script turns |
| 9695 | // the icon back on at some future time during this session. Also, the script |
| 9696 | // may provide some other means of displaying the tray menu. |
| 9697 | } |
| 9698 | } |
| 9699 | else |
| 9700 | { |
| 9701 | if (!mNIC.hWnd) // The icon doesn't exist, so create it. |
| 9702 | { |
| 9703 | CreateTrayIcon(); |
| 9704 | UpdateTrayIcon(true); // Force the icon into the correct pause/suspend state. |
| 9705 | } |
| 9706 | } |
| 9707 | } |
| 9708 | |
| 9709 | BIV_DECL_R(BIV_IconTip) |
| 9710 | { |