Print Page | Close Window

Skin manager bug?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=21992
Printed Date: 21 November 2024 at 11:53pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Skin manager bug?
Posted By: TomSerface
Subject: Skin manager bug?
Date 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);
}
 




Replies:
Posted By: kstowell
Date Posted: 10 December 2013 at 12:31am
Hi Tom,

Thanks for the suggestion, I included your fix for the next scheduled update.

Cheers!


-------------
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS<



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net