title: Win10 dark theme - how to use in WINAPI?
body: <p>Starting with <code>October 2018 Update (version 1809)</code> Win10 has support for Dark theme in Windows Explorer.</p>
  
  <p>It can be configured here:</p>
  
  <ul>
  <li>UI: <code>Desktop | Context Menu | Personalize | Colors | Choose your default app mode = Dark</code></li>
  <li>Registry : <code>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme</code> = <code>DWORD:0</code></li>
  </ul>
  
  <p>While this setting exists for a while now, it only affected UWP applications. However, with this Windows 10 release, it also affects Windows Explorer, which is a Desktop application. This means that Windows now have internal support for it. Still, Desktop applications other then Windows Explorer are not affected at the moment.</p>
  
  <p>I'd like to use it in my application. How is it implemented under the hood? Is there some way (manifest, WINAPI, etc) to subscribe for new dark theme?</p>
  
  <p><strong>Update 1:</strong><br>
  I noticed that Windows Explorer Control Panel is partially light and partially dark, so it should be a per-window setting, rather then per-process setting.</p>
  
  <p>One other example: Open File dialogs become dark in all Desktop applications, while the application itself remains in old light theme.</p>
  
  <p><strong>Update 2:</strong><br>
  I tried <code>SetWindowTheme(hwnd, L"Explorer", NULL);</code> for <code>TreeView</code> and <code>ListView</code>. This visibly changes <code>TreeView</code> style (<code>+</code> expand button becomes <code>V</code>), but the window remains white.</p>