In eMule.cpp, we have these functions:
Quote
bool CemuleApp::IsXPThemeActive() const
{
// TRUE: If an XP style (and only an XP style) is active
return theApp.m_ullComCtrlVer < MAKEDLLVERULL(6,16,0,0) && g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed();
}
bool CemuleApp::IsVistaThemeActive() const
{
// TRUE: If a Vista (or better) style is active
return theApp.m_ullComCtrlVer >= MAKEDLLVERULL(6,16,0,0) && g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed();
}
{
// TRUE: If an XP style (and only an XP style) is active
return theApp.m_ullComCtrlVer < MAKEDLLVERULL(6,16,0,0) && g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed();
}
bool CemuleApp::IsVistaThemeActive() const
{
// TRUE: If a Vista (or better) style is active
return theApp.m_ullComCtrlVer >= MAKEDLLVERULL(6,16,0,0) && g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed();
}
which are called in several places to changed the style correspondingly to the theme that is used.
However, these settings are *NOT* changed if the style changes while eMule is running!
E.g. @CClosableTabCtrl::InternalInit() and the main tabctrl in transferwnd:
Quote
if (theApp.IsVistaThemeActive())
m_dlTab.ModifyStyle(0, WS_CLIPCHILDREN);
m_dlTab.ModifyStyle(0, WS_CLIPCHILDREN);
Also, @CButtonsTabCtrl:
Quote
void CButtonsTabCtrl::InternalInit()
{
if (theApp.IsVistaThemeActive()) {
ModifyStyle(0, TCS_OWNERDRAWFIXED);
ModifyStyle(0, TCS_HOTTRACK);
}
}
LRESULT CButtonsTabCtrl::_OnThemeChanged()
{
// Owner drawn tab control seems to have troubles with updating itself due to an XP theme change..
bool bIsOwnerDrawn = (GetStyle() & TCS_OWNERDRAWFIXED) != 0;
if (bIsOwnerDrawn)
ModifyStyle(TCS_OWNERDRAWFIXED, 0); // Reset control style to not-owner drawn
Default(); // Process original WM_THEMECHANGED message
if (bIsOwnerDrawn)
ModifyStyle(0, TCS_OWNERDRAWFIXED); // Apply owner drawn style again
return 0;
}
{
if (theApp.IsVistaThemeActive()) {
ModifyStyle(0, TCS_OWNERDRAWFIXED);
ModifyStyle(0, TCS_HOTTRACK);
}
}
LRESULT CButtonsTabCtrl::_OnThemeChanged()
{
// Owner drawn tab control seems to have troubles with updating itself due to an XP theme change..
bool bIsOwnerDrawn = (GetStyle() & TCS_OWNERDRAWFIXED) != 0;
if (bIsOwnerDrawn)
ModifyStyle(TCS_OWNERDRAWFIXED, 0); // Reset control style to not-owner drawn
Default(); // Process original WM_THEMECHANGED message
if (bIsOwnerDrawn)
ModifyStyle(0, TCS_OWNERDRAWFIXED); // Apply owner drawn style again
return 0;
}
we should check if theApp.IsVistaThemeActive() is still true, otherwise, we shouldn't set the styles again, or am I wrong here again?
Best regards,
WiZ

Sign In
Register
Help




MultiQuote