Skin manager bug? |
Post Reply |
Author | |
TomSerface
Newbie Joined: 12 November 2013 Location: Oregon Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 12 November 2013 at 11:44am |
I have several static controls where I need to get the WM_COLORSTATIC message to do some background coloring and when I loaded a skin I no longer got that notification. I tracked the problem down to code in file XTPSkinObjectFrame.cpp in a routine called OnHookDefWindowProc starting on line 751. It was not looking to see if there was a message handler defined before coloring the background. I changed the code to add in the check below and that fixed my problem. The code wasn't changed in the latest release. This isn't a huge problem unless you want some static controls to have a different background than the skin.
BOOL CXTPSkinObjectFrame::OnHookDefWindowProc(UINT nMessage, WPARAM& wParam, LPARAM& lParam, LRESULT& lResult) { if (WM_CTLCOLORBTN == nMessage || WM_CTLCOLORDLG == nMessage || WM_CTLCOLORSTATIC == nMessage || WM_CTLCOLOREDIT == nMessage || WM_CTLCOLORLISTBOX == nMessage) { if (m_strClassName == _T("COMBOBOX")) return FALSE; if (IsDefWindowProcAvail(nMessage) && (m_dwDialogTexture != ETDT_ENABLETAB || !m_bActiveX)) { return FALSE; } if (nMessage == WM_CTLCOLOREDIT || nMessage == WM_CTLCOLORLISTBOX) { ::SetBkColor((HDC)wParam, GetColor(COLOR_WINDOW)); ::SetTextColor((HDC)wParam, GetColor(COLOR_WINDOWTEXT)); lResult = (LRESULT)GetMetrics()->m_brushWindow; return TRUE; } if (CWnd::GrayCtlColor((HDC)wParam, (HWND)lParam, (UINT)(nMessage - WM_CTLCOLORMSGBOX), GetMetrics()->m_brushDialog, 0)) { lResult = (LRESULT)GetClientBrush((HDC)wParam, (HWND)lParam, (UINT)(nMessage - WM_CTLCOLORMSGBOX)); return TRUE; } } return CXTPSkinObject::OnHookDefWindowProc(nMessage, wParam, lParam, lResult); } |
|
kstowell
Admin Group Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
Post Options
Thanks(0)
|
Hi Tom,
Thanks for the suggestion, I included your fix for the next scheduled update. Cheers!
|
|
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |