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

Method ShowTrayIcon

source/script2.cpp:9684–9707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9682}
9683
9684void 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
9709BIV_DECL_R(BIV_IconTip)
9710{

Callers 1

BIV_DECL_WFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected