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...
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.
How can I change the color then I intercept the WM_PAINT? I tested the SetBkgColor API but it doesn`t work.
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
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!
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.
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. mailto:firstname.lastname@example.org
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
If you check my pages I have a tut there on custom window captions and shapes too. Kinda just what you asked, huh?
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
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!
SetClassLong? And how can I use it to change the color settings?