Print Page | Close Window

Title bar Examples

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=10968
Printed Date: 23 November 2024 at 2:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Title bar Examples
Posted By: dedvalson
Subject: Title bar Examples
Date Posted: 09 June 2008 at 5:04pm
Hi,
 
I would like to modify one of the supplied skins to change the App Main Title Bar colors and also the color of the title bar text.
 
Are there any examples for this or could you at least point to where to start.
 
Thanks,
 
Don
 



Replies:
Posted By: Oleg
Date Posted: 10 June 2008 at 12:43am
Hi,
See SkinBuilder tool in 12.0 releasee.


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


Posted By: dedvalson
Date Posted: 10 June 2008 at 7:41am
Thanks,
 
That should have been obvious (DUH)
 
Could you answer one more question for me though.
 
I am using the Vista Skin supplied with the app on a Windows XP system. The color of the title bar (caption) is still being controlled by the desktop, not by my application. What do I need to do to make the Skin take precedence over the desktop theme?
 
Thanks,
 
Don
 


Posted By: Smucker
Date Posted: 10 June 2008 at 12:26pm
Here's the code I execute during startup or when the skin changes:

// Exclude a couple of MS DLLs that cause problems
XTPSkinManager()->ExcludeModule(_T("msctf.dll"));
XTPSkinManager()->ExcludeModule(_T("mshtml.dll"));

// Load the skin
XTPSkinManager()->LoadSkin(skinfile, skinini);

// Apply skin, including metrics, coloring and frame
XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics|xtpSkinApplyColors|xtpSkinApplyFrame);

// Apply skin to all new windows and threads
XTPSkinManager()->SetAutoApplyNewWindows(TRUE);
XTPSkinManager()->SetAutoApplyNewThreads(TRUE);

// Apply skin to current thread and window

XTPSkinManager()->EnableCurrentThread();
XTPSkinManager()->ApplyWindow(this->GetSafeHwnd());

// Redraw everything
XTPSkinManager()->RedrawAllControls();



Posted By: dedvalson
Date Posted: 10 June 2008 at 1:05pm
Thanks!


Posted By: Pariksh*t
Date Posted: 26 July 2008 at 12:42am

hello smucker,

this is pariksh*t. i am trying to change titlebars color of CColorDialog , i have written this code, but its not working. Please tell me what i am missing? or what i need to write or change? This includes your code also written above....

void CSampleDlgXDlg::OnBnClickedXButton()

{

// Exclude a couple of MS DLLs that cause problems

XTPSkinManager()->ExcludeModule(_T("msctf.dll"));

XTPSkinManager()->ExcludeModule(_T("mshtml.dll"));

// Load the skin

CString str1 = _T("C:\\Program Files\\Codejock Software\\MFC\\Xtreme ToolkitPro v12.0.0\\Bin\vc71\\styles");

XTPSkinManager()->LoadSkin(str1 + _T("Vista.cjstyles"), _T("NormalBlack2.INI"));

 

// Apply skin, including metrics, coloring and frame

XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics|xtpSkinApplyColors|xtpSkinApplyFrame);

// Apply skin to all new windows and threads

XTPSkinManager()->SetAutoApplyNewWindows(TRUE);

XTPSkinManager()->SetAutoApplyNewThreads(TRUE);

// Apply skin to current thread and window

XTPSkinManager()->EnableCurrentThread();

XTPSkinManager()->ApplyWindow(this->GetSafeHwnd());

// Redraw everything

XTPSkinManager()->RedrawAllControls();

//'/AfxMessageBox(_T("CXTPButton"));

CColorDialog cd;

cd.DoModal();

}



Posted By: Smucker
Date Posted: 26 July 2008 at 5:10pm
The parent of the color dialog may not be skinned.

Try

  cd.m_cc.hwndOwner = GetSafeHwnd();



-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)



Posted By: Pariksh*t
Date Posted: 28 July 2008 at 2:11am
hi
now my function looks like this but it is still not working
 

void CSampleDlgXDlg::OnBnClickedXButton()

{

// Exclude a couple of MS DLLs that cause problems

XTPSkinManager()->ExcludeModule(_T("msctf.dll"));

XTPSkinManager()->ExcludeModule(_T("mshtml.dll"));

// Load the skin

CString str1 = _T("C:\\Program Files\\Codejock Software\\MFC\\Xtreme ToolkitPro v12.0.0\\Bin\vc71\\styles");

XTPSkinManager()->LoadSkin(str1 + _T("Vista.cjstyles"), _T("NormalBlack2.INI"));

 

// Apply skin, including metrics, coloring and frame

XTPSkinManager()->SetApplyOptions(xtpSkinApplyMetrics|xtpSkinApplyColors|xtpSkinApplyFrame);

// Apply skin to all new windows and threads

XTPSkinManager()->SetAutoApplyNewWindows(TRUE);

XTPSkinManager()->SetAutoApplyNewThreads(TRUE);

// Apply skin to current thread and window

XTPSkinManager()->EnableCurrentThread();

CWnd *ptr = GetDlgItem(IDC_BUTTON2);

HWND hwnd = ptr->GetSafeHwnd();

XTPSkinManager()->ApplyWindow(hwnd);

// Redraw everything

XTPSkinManager()->RedrawAllControls();

//'/AfxMessageBox(_T("CXTPButton"));

CColorDialog cd;

cd.m_cc.hwndOwner = GetSafeHwnd();

XTPSkinManager()->ApplyWindow( cd.m_cc.hwndOwner);

cd.DoModal();

}

what is wrong in this?

do reply....


Posted By: Smucker
Date Posted: 28 July 2008 at 3:41am
I don't know. I enable skinning early in application startup (before my main window is created), rather than when a button is pressed. Is there a reason you're doing it where you are? Do you want to only skin the color dialog?



-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)



Posted By: Pariksh*t
Date Posted: 28 July 2008 at 4:23am
Actually in our application we using Office2007Black style. The systems messageboxes or the Dialogboxes like CColorDialog CFileDialog's tittle bar color is not changing. We want uniformity in our application.....thats why we want this....right now i am trying on sample application.....
 
can you send me your application?
 
do reply


Posted By: Smucker
Date Posted: 28 July 2008 at 1:08pm
I did not have to do anything special in my application to skin the color and file dialogs. The code above that you used is what I execute during startup (and whenever the skin changes).

Sorry, I can't send you my application because it is about 1 million lines of code in many projects, and is my company's property.



-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)




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