Changing system colors for a single application (Windows, .NET)

Posted by Michal Czardybon on Stack Overflow See other posts from Stack Overflow or by Michal Czardybon
Published on 2009-07-07T12:03:27Z Indexed on 2010/04/10 19:23 UTC
Read the original article Hit count: 361

Filed under:
|
|
|
|

I know I should generally avoid messing up with such system settings, but my application do already use nonstandard colors and I have no influence on that. I would like to be able to add standard .NET controls in some places, but their colors do not match. I would like to have a hack that would replace system colors for this one application. One more important thing to note is that it is a .NET application.

My (incomplete) ideas so far were:

  • To create a proxy User32.dll library with replaced GetSysColor, but it would be very tedious (731 functions to be redirected, 1 to be replaced) and I do not know how to force my application to use that particular copy.
  • To intercept somehow invocations to GetSysColors (unfortunatelly it is somewhere in the CLR I think).
  • To modify somehow .NET class SystemColors (in memory? is it possible?).

Do you have any idea, what is the best (and complete) way to achieve this?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about colors