任务栏窗口显示右键菜单时隐藏鼠标提示

This commit is contained in:
Zhong Yang
2022-01-26 23:55:06 +08:00
parent 5b51884073
commit fd7ce62c52
2 changed files with 14 additions and 2 deletions
+11 -2
View File
@@ -41,6 +41,7 @@ BEGIN_MESSAGE_MAP(CTaskBarDlg, CDialogEx)
ON_WM_PAINT()
ON_WM_CLOSE()
ON_WM_LBUTTONUP()
ON_MESSAGE(WM_EXITMENULOOP, &CTaskBarDlg::OnExitmenuloop)
END_MESSAGE_MAP()
@@ -1010,7 +1011,8 @@ void CTaskBarDlg::OnCancel()
void CTaskBarDlg::OnRButtonUp(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
m_menu_popuped = true;
m_tool_tips.Pop();
CheckClickedItem(point);
if (m_clicked_item.is_plugin && m_clicked_item.plugin_item != nullptr)
{
@@ -1075,7 +1077,7 @@ BOOL CTaskBarDlg::PreTranslateMessage(MSG* pMsg)
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) return TRUE;
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) return TRUE;
if (theApp.m_taskbar_data.show_tool_tip && IsWindow(m_tool_tips.GetSafeHwnd()) && (pMsg->message == WM_LBUTTONDOWN ||
if (theApp.m_taskbar_data.show_tool_tip && !m_menu_popuped && IsWindow(m_tool_tips.GetSafeHwnd()) && (pMsg->message == WM_LBUTTONDOWN ||
pMsg->message == WM_LBUTTONUP ||
pMsg->message == WM_MOUSEMOVE))
{
@@ -1281,3 +1283,10 @@ void CTaskBarDlg::OnLButtonUp(UINT nFlags, CPoint point)
CDialogEx::OnLButtonUp(nFlags, point);
}
afx_msg LRESULT CTaskBarDlg::OnExitmenuloop(WPARAM wParam, LPARAM lParam)
{
m_menu_popuped = false;
return 0;
}
+3
View File
@@ -94,6 +94,7 @@ protected:
bool m_connot_insert_to_task_bar{ false }; //如果窗口无法嵌入任务栏,则为true
bool m_taskbar_on_top_or_bottom{ true }; //如果任务栏在屏幕顶部或底部,则为ture
int m_error_code{};
bool m_menu_popuped{ false }; //指示当前是否有菜单处于弹出状态
CFont m_font; //字体
@@ -163,4 +164,6 @@ public:
afx_msg void OnPaint();
afx_msg void OnClose();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
protected:
afx_msg LRESULT OnExitmenuloop(WPARAM wParam, LPARAM lParam);
};