IonicWind Software

IWBasic => GUI Central => Topic started by: Bruce Peaslee on December 01, 2019, 04:48:58 PM

Title: Title Bar Color
Post by: Bruce Peaslee on December 01, 2019, 04:48:58 PM
My PC had been giving me some problems. Along with that, Windows 7 is about to go under Microsoft's bus, so I decided now was the time to get a new box.

Windows 10 (sigh). Some engineers at Microsoft decided all window title bars should be colored white. There are settings to change all title bars, but I just want to change the one in my app.

Has anyone dealt with this? Thanks.
Title: Re: Title Bar Color
Post by: ckoehn on December 02, 2019, 02:57:32 PM
I will toss an answer out here and if it is wrong someone can correct me.

On my windows machine, the active window title bar is a different color.  That being said, to change just one windows title bar to any color you want is not impossible, but would require a lot of work from what I have read.  You not only change the color, you also have to take care of the border redraw and the mouse move and click events.

I tried to use @NOCAPTION|@SIZE but that leaves a weird bar at the top. If you use just @NOCAPTION you are back to taking care of the border and mouse move and click events.

Hope someone has an answer for you because I'd be interested in it too.

Later,
Clint
Title: Re: Title Bar Color
Post by: fasecero on December 03, 2019, 12:43:25 PM
Windows states that it is the user who must choose that background color and not the developer. But there are times where a certain color will match best the content of the client area. I was also always interested in this.

There are 2 ways to do it, the "easy" one (not easy at all but more simple than the second) is to not to use any frame at all and draw it all by yourself inside the client area. Andy made a good example of this approach some time ago, it must be in the forum.

The second, far more complex, is to start with a normal window, call some DWM functions (mainly DwmExtendFrameIntoClientArea), subclass the window procedure and process the non-client area messages (such as WM_NCACTIVATE, WM_NCCALCSIZE, and WM_NCHITTEST) and some undocumented messages, like 0xAE which draw the themed window borders. And you still need to draw everything by yourself, of course. Getting all of this to work correctly is very complex and it is a pending task that I have for ages.
Title: Re: Title Bar Color
Post by: Bruce Peaslee on December 08, 2019, 11:52:18 AM
The attached clip shows what I am after. I spend a lot of time on getting just the right look. In this window the title bar color is changed and the menu text is bold. The problem: this is done with Winaero Tweaker so everything in the system changes. I understand that we can create windows from scratch, and maybe I will do that sometime as a "left to the reader" exercise, but I wish it were easier.
Title: Re: Title Bar Color
Post by: LarryMc on December 08, 2019, 07:34:15 PM
Bruce

How about getting/sending me each of the menu items that make up each of your menu list.
And the name of your main window. I'll look into seeing if I can help you.

LarryMc
Title: Re: Title Bar Color - Here you are Bruce
Post by: Andy on December 08, 2019, 10:53:14 PM
Bruce,

I did the hard work on this for every one last year and posted it.

Check out (in CustomWindow.iwb) lines 250 & 251 and the menu items with custom fonts, sizes, colours, and icons.

And just change the jpeg file backgrounds to the background colour of your title bar so they match.

It's all here for you, just enjoy it!

Don't forget to copy the .inc files to your IWBDev\Include folder & .lib file to your IWBDev\Libs folder.

Attached are the files - Compile CustomWindow.iwb as single (F8).

Andy.
:)
Title: Re: Title Bar Color
Post by: Bruce Peaslee on December 09, 2019, 09:48:03 AM
Larry,

Let me see what Andy did first. Thanks for the offer.