本文整理汇总了C++中TrayIcon::HideWindowToTray方法的典型用法代码示例。如果您正苦于以下问题:C++ TrayIcon::HideWindowToTray方法的具体用法?C++ TrayIcon::HideWindowToTray怎么用?C++ TrayIcon::HideWindowToTray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrayIcon
的用法示例。
在下文中一共展示了TrayIcon::HideWindowToTray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTryIcon
LRESULT TrayIcon::OnTryIcon(HWND hWnd, UINT messg, WPARAM wParam, LPARAM lParam)
{
#ifdef _DEBUG
wchar_t szMsg[128];
#endif
switch (lParam)
{
case WM_LBUTTONUP:
case NIN_BALLOONUSERCLICK:
#ifdef _DEBUG
_wsprintf(szMsg, SKIPLEN(countof(szMsg)) (lParam==WM_LBUTTONUP) ? L"TSA: WM_LBUTTONUP(%i,0x%08X)\n" : L"TSA: NIN_BALLOONUSERCLICK(%i,0x%08X)\n", (int)wParam, (DWORD)lParam);
DEBUGSTRICON(szMsg);
#endif
if (gpSet->isQuakeStyle)
{
bool bJustActivate = false;
SingleInstanceShowHideType sih = sih_QuakeShowHide;
SingleInstanceShowHideType sihHide = gpSet->isMinToTray() ? sih_HideTSA : sih_Minimize;
if (IsWindowVisible(ghWnd) && !gpConEmu->isIconic())
{
if (gpSet->isAlwaysOnTop || (gpSet->isQuakeStyle == 2))
{
sih = sihHide;
}
else
{
UINT nVisiblePart = gpConEmu->IsQuakeVisible();
if (nVisiblePart >= QUAKEVISIBLELIMIT)
{
sih = sihHide;
}
else
{
// Если поверх ConEmu есть какое-то окно, то ConEmu нужно поднять?
// Не "выезжать" а просто "вынести наверх", если видимая область достаточно большая
bJustActivate = (nVisiblePart >= QUAKEVISIBLETRASH) && !gpConEmu->isIconic();
}
}
}
if (bJustActivate)
{
SetForegroundWindow(ghWnd);
}
else
{
gpConEmu->DoMinimizeRestore(sih);
}
}
else if (gpSet->isAlwaysShowTrayIcon() && IsWindowVisible(ghWnd))
{
if (gpSet->isMinToTray())
Icon.HideWindowToTray();
else
SendMessage(ghWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
}
else
{
Icon.RestoreWindowFromTray();
}
switch (m_MsgSource)
{
case tsa_Source_Updater:
m_MsgSource = tsa_Source_None;
gpConEmu->CheckUpdates(2);
break;
case tsa_Push_Notify:
gpConEmu->mp_PushInfo->OnNotificationClick();
m_MsgSource = tsa_Source_None;
break;
}
break;
case NIN_BALLOONSHOW:
#ifdef _DEBUG
_wsprintf(szMsg, SKIPLEN(countof(szMsg)) L"TSA: NIN_BALLOONSHOW(%i,0x%08X)\n", (int)wParam, (DWORD)lParam);
DEBUGSTRICON(szMsg);
#endif
mn_BalloonShowTick = GetTickCount();
break;
case NIN_BALLOONTIMEOUT:
{
#ifdef _DEBUG
_wsprintf(szMsg, SKIPLEN(countof(szMsg)) L"TSA: NIN_BALLOONTIMEOUT(%i,0x%08X)\n", (int)wParam, (DWORD)lParam);
DEBUGSTRICON(szMsg);
#endif
if (mb_SecondTimeoutMsg
|| (mn_BalloonShowTick && ((GetTickCount() - mn_BalloonShowTick) > MY_BALLOON_TICK)))
{
m_MsgSource = tsa_Source_None;
Icon.RestoreWindowFromTray(TRUE);
}
else if (!mb_SecondTimeoutMsg && (mn_BalloonShowTick && ((GetTickCount() - mn_BalloonShowTick) > MY_BALLOON_TICK)))
{
mb_SecondTimeoutMsg = true;
}
}
//.........这里部分代码省略.........