Skip to content

Commit a7b0877

Browse files
committed
修正Win10下当任务栏在桌面的两侧时,关闭任务栏窗口后无法还原任务栏位置的问题
1 parent a2a3a04 commit a7b0877

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

TrafficMonitor/ClassicalTaskbarDlg.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ void CClassicalTaskbarDlg::CheckTaskbarOnTopOrBottom()
123123
CRect rcBar;
124124
if (m_hTaskbar != 0)
125125
{
126-
::GetWindowRect(m_hMin, rcMin); //获得最小化窗口的区域
127-
::GetWindowRect(m_hBar, rcBar); //获得二级容器的区域
128-
if (m_left_space == 0)
129-
m_left_space = rcMin.left - rcBar.left;
130-
if (m_top_space == 0)
131-
m_top_space = rcMin.top - rcBar.top;
126+
//::GetWindowRect(m_hMin, rcMin); //获得最小化窗口的区域
127+
//::GetWindowRect(m_hBar, rcBar); //获得二级容器的区域
128+
//if (m_left_space == 0)
129+
// m_left_space = rcMin.left - rcBar.left;
130+
//if (m_top_space == 0)
131+
// m_top_space = rcMin.top - rcBar.top;
132132

133133
::GetWindowRect(m_hTaskbar, rect); //获取任务栏的矩形区域
134134
m_taskbar_on_top_or_bottom = (rect.Width() >= rect.Height()); //如果任务栏的宽度大于高度,则任务在屏幕的顶部或底部

TrafficMonitor/TaskBarDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ BOOL CTaskBarDlg::OnInitDialog()
11111111

11121112
m_pDC = GetDC();
11131113

1114-
m_hTaskbar = FindTaskbarHandle(m_is_secondary_display); //寻找类名是Shell_TrayWnd的窗口句柄
1114+
m_hTaskbar = FindTaskbarHandle(m_is_secondary_display); //查找任务栏的句柄
11151115
::GetWindowRect(m_hTaskbar, m_rcTaskbar); //获得任务栏的矩形区域
11161116

11171117
//设置窗口透明色

0 commit comments

Comments
 (0)