Skip to content

Commit 1c29733

Browse files
author
Jan Wilmans
committed
fixed titlebar when Global Win32 was toggled
1 parent 6811fb9 commit 1c29733

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

application/DebugViewpp/MainFrame.cpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,24 @@ void CMainFrame::Pause()
14001400
m_logSources.AddMessage("<paused>");
14011401
}
14021402

1403+
void CMainFrame::UpdateTitle()
1404+
{
1405+
std::wstring title = L"Paused";
1406+
if ((m_pLocalReader != nullptr) && (m_pGlobalReader != nullptr))
1407+
{
1408+
title = L"Capture Win32 & Global Win32 Messages";
1409+
}
1410+
else if (m_pLocalReader != nullptr)
1411+
{
1412+
title = L"Capture Win32";
1413+
}
1414+
else if (m_pGlobalReader != nullptr)
1415+
{
1416+
title = L"Capture Global Win32";
1417+
}
1418+
SetTitle(title);
1419+
}
1420+
14031421
void CMainFrame::Resume()
14041422
{
14051423
SetTitle();
@@ -1438,21 +1456,7 @@ void CMainFrame::Resume()
14381456
m_tryGlobal = false;
14391457
}
14401458
}
1441-
1442-
std::wstring title = L"Paused";
1443-
if ((m_pLocalReader != nullptr) && (m_pGlobalReader != nullptr))
1444-
{
1445-
title = L"Capture Win32 & Global Win32 Messages";
1446-
}
1447-
else if (m_pLocalReader != nullptr)
1448-
{
1449-
title = L"Capture Win32";
1450-
}
1451-
else if (m_pGlobalReader != nullptr)
1452-
{
1453-
title = L"Capture Global Win32";
1454-
}
1455-
SetTitle(title);
1459+
UpdateTitle();
14561460
}
14571461

14581462
void CMainFrame::OnLogPause(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
@@ -1480,6 +1484,7 @@ void CMainFrame::OnLogGlobal(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl
14801484
m_logSources.Remove(m_pGlobalReader);
14811485
m_pGlobalReader = nullptr;
14821486
}
1487+
UpdateTitle();
14831488
}
14841489

14851490
void CMainFrame::OnLogHistory(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)

application/DebugViewpp/MainFrame.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class CMainFrame : public CTabbedFrameImpl<CMainFrame, CDotNetTabCtrl<SelectedTa
132132
bool IsPaused() const;
133133
void Pause();
134134
void Resume();
135+
void UpdateTitle();
135136
bool GetAlwaysOnTop() const;
136137
void SetAlwaysOnTop(bool value);
137138

0 commit comments

Comments
 (0)