diff options
Diffstat (limited to 'plugins/TabSRMM/src/msgdlgother.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 7dd848bec1..77e6e612ea 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -2350,7 +2350,7 @@ void CMsgDialog::UpdateTitle() else if (m_wStatus != m_wOldStatus) bChanged = true; - SendMessage(m_hwnd, DM_UPDATEWINICON, 0, 0); + UpdateWindowIcon(); wchar_t fulluin[256]; if (m_bIsMeta) @@ -2406,6 +2406,31 @@ void CMsgDialog::UpdateTitle() } ///////////////////////////////////////////////////////////////////////////////////////// + +void CMsgDialog::UpdateWindowIcon() +{ + if (m_hXStatusIcon) { + DestroyIcon(m_hXStatusIcon); + m_hXStatusIcon = nullptr; + } + + if (LPCSTR szProto = m_cache->getProto()) { + m_hTabIcon = m_hTabStatusIcon = GetMyContactIcon("MetaiconTab"); + if (M.GetByte("use_xicons", 1)) + m_hXStatusIcon = GetXStatusIcon(); + + SendDlgItemMessage(m_hwnd, IDC_PROTOCOL, BUTTONSETASDIMMED, (m_dwFlagsEx & MWF_SHOW_ISIDLE) != 0, 0); + SendDlgItemMessage(m_hwnd, IDC_PROTOCOL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(m_hXStatusIcon ? m_hXStatusIcon : GetMyContactIcon("MetaiconBar"))); + + if (m_pContainer->m_hwndActive == m_hwnd) + m_pContainer->SetIcon(this, m_hXStatusIcon ? m_hXStatusIcon : m_hTabIcon); + + if (m_pWnd) + m_pWnd->updateIcon(m_hXStatusIcon ? m_hXStatusIcon : m_hTabIcon); + } +} + +///////////////////////////////////////////////////////////////////////////////////////// // called whenever a group chat tab becomes active(either by switching tabs or activating a // container window |