Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Changing Theme Colors on Windows (DwmSetColorizationParameters)

I have uploaded my source on Github: https://github.com/AlbinoDrought/DwmColorization

Some guy made a tool to instantly change the Windows colors, and I ported the base of it (unmanaged code references) to C# and built a helper around it.

Some usage examples are:

PHP Code

<?php 
using System
.Drawing;
using AlbinoDrought;
using System.Threading;

...

ColorShiftHelper csh = new ColorShiftHelper();
csh.setColor(Color.Red);
Thread.Sleep(500);

csh.blink(Color.Yellow);
Thread.Sleep(500);

csh.blendInto(Color.Green);
Thread.Sleep(500); 
See Examples/TestForm.cs for in-use code

Here is an animation of what the original does, mine is similar (but with no real interface): http://www.gfycat.com/EqualMeagerAnglerfish

See what cool things you can make with it. So far I've made the necessary change-to-every-color-very-fast program, a tool to flash the theme color when somebody joins the Skype call I'm in, and one to blend to the color at your mouse cursor just for fun.
Code
private ColorShiftHelper csh = new ColorShiftHelper();
      private void Form1_Load(System.Object sender, System.EventArgs e) {
      csh.blendInto(Color.Pink);
      }
      private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) {
      csh.resetColor();
      }

Should probably include FormClosing Event that resets color, just a suggestion. I didn't realize it had a reset method at first and thought I would need to code it in. Neat Discovery. :)
I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
(Jul 30, 2014 08:59 PM)Eternal Darkness Wrote:  
Code
private ColorShiftHelper csh = new ColorShiftHelper();
      private void Form1_Load(System.Object sender, System.EventArgs e) {
      csh.blendInto(Color.Pink);
      }
      private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) {
      csh.resetColor();
      }

Should probably include FormClosing Event that resets color, just a suggestion. I didn't realize it had a reset method at first and thought I would need to code it in. Neat Discovery. :)

Thanks. In the included TestForm.cs I perform a click on the reset button (as of now it only resets the theme color).

Code
 
      private void TestForm_FormClosing(object sender, FormClosingEventArgs e)
      {
      btnReset.PerformClick();
      }

      private void btnReset_Click(object sender, EventArgs e)
      {
      csh.resetColor();
      }

I did it this way incase later I added more things that needed to be reset. I can see some reasons that people would not want to reset the color, though.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Emre_Jan 12, 2021 11:16 PM 0 141 Jan 12, 2021 11:16 PM
Last Post: Emre_
[Python] by jailbotJul 15, 2019 06:45 AM 5 217 Jul 15, 2019 06:45 AM
Last Post: jailbot
[C#] by cocaine_monkeyNov 10, 2017 12:08 PM 3 198 Nov 10, 2017 12:08 PM
Last Post: cocaine_monkey