Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why old style title bar in Windows XP?

Status
Not open for further replies.

VincentP

Programmer
Apr 1, 2001
116
I have a very complex project I started many years ago, when I had Windows 98SE on my computer. Now that I migrated to Windows XP, I noticed that my application's title bar is displayed as an "old style Windows 9x" title bar, instead of the rounder version of Windows XP.

My application is an SDI, and all the secondary windows are displayed with the appropriate title bar. If I create a new SDI project and run it, it also displays the XP title bar. It must be something I overwrote somewhere.

I would appreciate any thoughts on where to look. Has anybody experienced this probelm before?

Thanks,

Vincent
 
Double check the properties of the dialog and check your OnInitDialog() and InitInstance()??
i.e. I noticed the following code in one of my applications(in the InitInstance rountine)
Code:
[green]// InitCommonControls() is required on Windows XP if an application
	// manifest specifies use of ComCtl32.dll version 6 or later to enable
	// visual styles.  Otherwise, any window creation will fail.
[/green]
	InitCommonControls();

and check any other routines you call during initialisation?

Good luck!!
 
Thanks for the advice. I found where my code removes the nice Win XP title bar effect, and it does not seem to be related to initialization. Here is a summary:

I have a SDI application, using a CFormView. I can have any type of WinXP buttons on the form by using a .manifest file. All of my secondary dialogs have the WinXP title bar, even without the .manifest file. However, my main window never has the WinXP title bar.

I found out that the culprit seems to be the SetWindowRgn I use on CMainFrame inside the View's OnDraw message. I have an option in my program to display a window with "holes" in it. However, I need to set a region for the window even when it is displayed as normal, a large rectangular form.

I did some tests, like:
GetParent()->GetWindowRgn( rgn );
GetParent()->SetWindowRgn( (HRGN)rgn, true );
and this is enough to remove the WinXP title bar effect!

Next, I tried
GetParent()->SetWindowRgn( NULL, true );
and it sort of works: the title bar is WinXP style, but the rounded corners are actually not rounded anymore. And of course, if I set the option to have "holes", then I need a non-NULL region, and the title bar style goes away.

Can anyone help me get this right?

Thanks,

Vincent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top