Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Skin manager bug?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Skin manager bug?

 Post Reply Post Reply
Author
Message Reverse Sort Order
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Topic: Skin manager bug?
    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<
Back to Top
TomSerface View Drop Down
Newbie
Newbie


Joined: 12 November 2013
Location: Oregon
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomSerface Quote  Post ReplyReply Direct Link To This Post 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);
}
 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.