Print Page | Close Window

GetSysColor / SkinFramework (Bug?)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4603
Printed Date: 16 July 2025 at 4:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetSysColor / SkinFramework (Bug?)
Posted By: ABuenger
Subject: GetSysColor / SkinFramework (Bug?)
Date Posted: 17 July 2006 at 10:55am
If skinning is disabled for a window GetSysColor (COLOR_3DFACE) still returns the color the item would get if it's skinned.
 
The hook function should check wheter the window is skinned or not.
 


-------------
Codejock support



Replies:
Posted By: Oleg
Date Posted: 17 July 2006 at 12:43pm
Hello,
 
How do you see it? GetSysColor is global function, how skinmanager can determine what window you want to draw?
 
As solution remove xtpSkinApplyColors from ApplyOptions:
 
XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics | xtpSkinApplyFrame);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ABuenger
Date Posted: 17 July 2006 at 1:29pm
Here is a screenshot of the sheet with skinning disabled. The Grid calls GetSysColor to get the color for the fixed cells. It's the same with the list control on the left.
 
If I remove the xtpSkinApplyColors flag the list control is drawn correctly, but GetSysColor still return the wrong color.
 
DWORD dwApplyOptions = XTPSkinManager()->GetApplyOptions ();
XTPSkinManager()->SetApplyOptions(dwApplyOptions & ~xtpSkinApplyColors);
 
sheet.DoModal ();
 
XTPSkinManager()->SetApplyOptions(dwApplyOptions);
 
I've also noticed several other bugs with the SkinFramework.
 
The above code causes an assertion in CXTPSkinManagerApiHook::OnHookLoadLibraryA because GetInstance()->GetHookedFunction(xtpSkinApiLoadLibraryA); returns NULL the first time OnHookLoadLibrary is beeing called after disabling skinning / settings apply options.
 
I'm using the popular MFCGridCtrl and if skinning is applied and then a scrollbar arrow pressed the grid only scrolls once but doesn't keep scrolling until the button is released. So you've to click/release, click/release to scroll through the grid.
 
If I disable skinning with XTPSkinManager()->SetAutoApplyNewWindows (FALSE); before showing the sheet and then press the arrow button the grid keeps scrolling but the scrollbar doesn't move.
 
If I don't load a skin everything works correctly, you press an arrow button and the grid start and keeps scrolling whilst the scrollbar moves up or down.
 
 


-------------
Codejock support


Posted By: Oleg
Date Posted: 17 July 2006 at 3:47pm
Hi,
 
easy to fix MFCGridCtrl  than disable this  window for SkinFramework :)
 
in void CGridCtrl::OnTimer(UINT nIDEvent)
 
replace

if (nIDEvent != WM_LBUTTONDOWN)

return;

 
to
 

if (nIDEvent != WM_LBUTTONDOWN)

{

CWnd::OnTimer(nIDEvent);

return;

}



-------------
Oleg, Support Team
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