Tech Support > Microsoft Windows > Development Resources > Set Background Color for Running Windows Application
Set Background Color for Running Windows Application
Posted by jfox00@gmail.com on April 3rd, 2008


Issue: I am trying to set the background window color of a running
windows application from my application. My application is a c# .net
2.0 application. I have successfully found the window handle for the
application I wish to change using the FindWindow api call, and I
would like to use a SendMessage api call to change the background
color of that application. If the SendMessage api can not be used,
not a problem - what should I be looking for? I searched and found
some posts that were C++ related, but did not really see a 'complete
solution' that I could cannibalize into a working C# version. Any
help would be greatly appreciated.

Background: The goal of my application is to allow a user to set two
or more identical applications apart. So, if I had 4 calc.exe
applications running, for example, I want to be able set one to red,
one to green, one to blue, and one to orange, so they can be
distinguished from each other very easily. Maybe even setting the
Title Bar text, and Title Bar color, would be sufficient, but I wanted
to go with the color (either the border color, or background color)
since it would be more obvious. I do not want to work with
transparency.

Thanks - Jen

Posted by Christian ASTOR on April 3rd, 2008


On 3 avr, 19:38, jfo...@gmail.com wrote:

In C/C++, WH_GETMESSAGE (DLL) then SetClassLong() & GCL_HBRBACKGROUND
or subclassing and e.g. WM_ERASEBKGND

Posted by jfox00@gmail.com on April 4th, 2008


Thanks for the reply. I'm not very experienced in C/C++,
unfortunately, which is why I wanted to try and tackle this problem in
C#. If anyone else has some experience with C# and my solution (or an
idiot proof, coded solution in C/C++) please let me know. Thank you.
Jen.



Similar Posts