March 29, 2024, 01:15:35 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Title Bar Color

Started by Bruce Peaslee, December 01, 2019, 04:48:58 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bruce Peaslee

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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

ckoehn

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

fasecero

December 03, 2019, 12:43:25 PM #2 Last Edit: December 03, 2019, 12:47:15 PM by fasecero
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.

Bruce Peaslee

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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

December 08, 2019, 10:53:14 PM #5 Last Edit: December 09, 2019, 05:17:16 AM by Andy
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.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Bruce Peaslee

Larry,

Let me see what Andy did first. Thanks for the offer.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles