Is there a way to change the color of my active window without changing the color of other applications? SetSysColor changes the color of all running applications! Is there an API that can do this job? And how can I display a window without title bar? thanks...
Posted on 2001-04-14 10:49:00 by hansWurst
To change the color, you could intercept the WM_NCPAINT message and the WM_PAINT message and draw your own stuff. When you create a window with CreateWindowEx, you have to tell it to give you a titlebar, so all you have to do is not use the WS_CAPTION style.
Posted on 2001-04-14 12:56:00 by Hel
How can I change the color then I intercept the WM_PAINT? I tested the SetBkgColor API but it doesn`t work.
Posted on 2001-04-14 13:37:00 by hansWurst
You should make a brush the color you want using CreateSolidBrush, then get the your window size and then get a DC on your window using GetDC then fill the area with the color using FillRect that should work.... Another faster way is to do this: make a brush the color you want: invoke CreateSolidBrush,yourColor then insert the handle in eax into: m2m wc.hbrBackground, eax this is at the time you create your window. This message was edited by Zcoder, on 4/14/2001 1:56:10 PM
Posted on 2001-04-14 13:51:00 by Zcoder
Did this work also on the caption bar? Can I change the color of the caption bar also with SolidBrush/DC/FillRect? And how can I change the color of the text? thanks for help!
Posted on 2001-04-14 14:38:00 by hansWurst
You can't change the color of the title bar using this method, I don't know if there is a API to let you. I wanted to do the same, so what I did was I made a window without a title bar, then I used a bitmap that look like one that was a color I wanted. Then there came the problem with not having a title bar, you can't move it, so you have to use WM_MOUSEMOVE to move your own window, you I have a program in which I did this trick in. if you want it just let me know.
Posted on 2001-04-14 14:56:00 by Zcoder
Yes, this is a good idea with the painted title bar! It will be great if you can sent me the example. Thanks for the help.
Posted on 2001-04-14 15:41:00 by hansWurst
More then that : you can make a normal window with title bar and stuff, then get a DC to the whole window not only the Client area, use this Dc to paint OVER your window whatever you like. This way, you "skin" your App but still have all the functions of the system for move,minimize,restore,resize etc
Posted on 2001-04-14 16:03:00 by BogdanOntanu
If you check my pages I have a tut there on custom window captions and shapes too. Kinda just what you asked, huh?
Posted on 2001-04-14 16:43:00 by Ernie
BogdanOntanu, I might try your IDEA, but when you move the window with the mouse, won't windows draw it the way it is suposse to be? messing up your title bar again?..... This message was edited by Zcoder, on 4/14/2001 6:29:02 PM
Posted on 2001-04-14 18:28:00 by Zcoder
Ok, it works with DC painting over the whole window, but the problem is now to change the color of system buttons min/max/close.. I think that the best way is to change the whole color set of the window like the method with SetSysColor. Is there no way to change only the color scheme of my application? This would also work faster!
Posted on 2001-04-15 00:06:00 by hansWurst
Posted on 2001-04-16 01:40:00 by The Svin
SetClassLong? And how can I use it to change the color settings?
Posted on 2001-04-17 12:43:00 by hansWurst
Posted on 2001-04-18 07:43:00 by The Svin