Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Title bar Examples
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Title bar Examples

 Post Reply Post Reply
Author
Message
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Topic: Title bar Examples
    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
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 12:43am
Hi,
See SkinBuilder tool in 12.0 releasee.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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();

Back to Top
dedvalson View Drop Down
Groupie
Groupie


Joined: 10 April 2008
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote dedvalson Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 1:05pm
Thanks!
Back to Top
Pariksh*t View Drop Down
Groupie
Groupie
Avatar

Joined: 26 June 2008
Location: India
Status: Offline
Points: 77
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pariksh*t Quote  Post ReplyReply Direct Link To This Post 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();

}

Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
Pariksh*t View Drop Down
Groupie
Groupie
Avatar

Joined: 26 June 2008
Location: India
Status: Offline
Points: 77
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pariksh*t Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
Pariksh*t View Drop Down
Groupie
Groupie
Avatar

Joined: 26 June 2008
Location: India
Status: Offline
Points: 77
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pariksh*t Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

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.