MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / SetTrayTip

Method SetTrayTip

source/script2.cpp:9720–9734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9718}
9719
9720void 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
9736BIV_DECL_R(BIV_IconFile)
9737{

Callers 1

BIV_DECL_WFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected