用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.4 KiB

5 months ago
#include "stdafx.h"
#include "SShellNofityHwnd2.h"
namespace SOUI
{
CShellNotifyHwnd2::CShellNotifyHwnd2(SHostWnd * pMainWnd, SShellNotifyIcon* shellnotifyicon) :m_pMainWnd(pMainWnd),m_ShellNotifyIcon(shellnotifyicon)
{
MsgTaskbarCreated = RegisterWindowMessage(_T("TaskbarCreated"));
Create(_T("shell_nofity_msg_windows"), 0, 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr);
}
//托盘通知消息处理函数
LRESULT CShellNotifyHwnd2::OnIconNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL)
{
LRESULT bRet = S_FALSE;
switch (lParam)
{
case WM_RBUTTONDOWN:
{
m_ShellNotifyIcon->ShowMenu();
bRet = S_OK;
}break;
case WM_LBUTTONDOWN:
{
if (m_pMainWnd->IsWindowVisible())
m_pMainWnd->ShowWindow(SW_HIDE);
else
{
m_pMainWnd->ShowWindow(SW_SHOW);
if(m_pMainWnd->IsIconic())
{
m_pMainWnd->SendMessage(WM_SYSCOMMAND,SC_RESTORE);
}
SetForegroundWindow(m_pMainWnd->m_hWnd);
}
bRet = S_OK;
}break;
}
return bRet;
}
LRESULT CShellNotifyHwnd2::OnTaskbarCreated(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL)
{
return m_ShellNotifyIcon->Show();
}
void CShellNotifyHwnd2::OnFinalMessage(HWND hWnd)
{
__super::OnFinalMessage(hWnd);
delete this;
}
void CShellNotifyHwnd2::OnTimer(UINT_PTR nIDEvent)
{
switch (nIDEvent)
{
case ANI_TIMER_ID:
{
m_ShellNotifyIcon->NextFrame();
}break;
default:
break;
}
}
}