title: Setting title bar and border colors programmatically
body: <p>I am trying to change my application' s title bar and border colors programmatically. I tried lots of things but with no success, and decided to change these colors system-wide. Because it is also acceptable for me to change title bar and border colors as my application is running, and revert them back in the end of my application. (Managed environment, with small set of applications running)</p>
  
  <p>Is it possible to change these colors dynamically(process-wide, or system-wide unless process-wide change is possible)? Can you suggest any way to achieve this?</p>
  
  <p>I tried something like the following but it doesn' t do what I want:</p>
  
  <pre><code>int aElements[2] = {COLOR_WINDOW, COLOR_ACTIVECAPTION};
  DWORD aOldColors[2];
  DWORD aNewColors[2];
  
  aOldColors[0] = GetSysColor(aElements[0]); 
  aOldColors[1] = GetSysColor(aElements[1]); 
  aNewColors[0] = RGB(0x80, 0x80, 0x80);  // light gray 
  aNewColors[1] = RGB(0x80, 0x00, 0x80);  // dark purple 
  
  SetSysColors(2, aElements, aNewColors);
  SetSysColors(2, aElements, aOldColors);
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is exactly what I want: </p>
  
  <p><a href="https://i.stack.imgur.com/LTny6.png"><img src="https://i.stack.imgur.com/LTny6.png" alt="enter image description here"></a></p>