| 9718 | } |
| 9719 | |
| 9720 | void Script::SetTrayTip(LPTSTR aText) |
| 9721 | { |
| 9722 | // Allocate mTrayIconTip on first use even if aText is empty, so that |
| 9723 | // it will override the use of mFileName as the tray tip text. |
| 9724 | // This allows the script to completely disable the tray tooltip. |
| 9725 | if (!mTrayIconTip) |
| 9726 | mTrayIconTip = SimpleHeap::Alloc<TCHAR>(_countof(mNIC.szTip)); // SimpleHeap improves avg. case mem load. |
| 9727 | if (mTrayIconTip) |
| 9728 | tcslcpy(mTrayIconTip, aText, _countof(mNIC.szTip)); |
| 9729 | if (mNIC.hWnd) // i.e. only update the tip if the tray icon exists (can't work otherwise). |
| 9730 | { |
| 9731 | UPDATE_TIP_FIELD |
| 9732 | Shell_NotifyIcon(NIM_MODIFY, &mNIC); // Currently not checking its result (e.g. in case a shell other than Explorer is running). |
| 9733 | } |
| 9734 | } |
| 9735 | |
| 9736 | BIV_DECL_R(BIV_IconFile) |
| 9737 | { |