- Windows 7 black glass theme how to#
- Windows 7 black glass theme full#
- Windows 7 black glass theme code#
using (Bitmap bm = CaptureScreenShot()) SendMessage(hWndTheming, (uint)WM_CLOSE, 0, 0) IntPtr hWndTheming = FindWindow("CabinetWClass", null) String ThemeOutput = StartProcessAndWait("rundll32.exe", () + " + () + "\\desk.cpl /Action:OpenTheme /file:\"" + ThemePath + "\"", ref bTimedOut) Set the theme file as like a user would have clicked it Throw new Exception("The resource theme file could not be extracted") Using (BinaryWriter sw = new BinaryWriter(new FileStream(ThemePath, FileMode.OpenOrCreate))) Throw new Exception("The file '" + ThemePath + "' exists and can not be deleted. Then executes the desk.cpl with rundll32.exe, waits 3 sceonds, then sends WM_CLOSE (0x0010), waits for the command to be process (the time it takes for the theme to be set).
Windows 7 black glass theme code#
The code snippet below extracts a file from resource (a themepack). Otherwise the theme will not be set and the application closes right away. You should wait a sec before sending WM_CLOSE. So if you start it with the monstrous (but genious) rundll32.exe method suggested by "Campbell". Meaning that in the SendMessages returns, you know that the theme dialog is closed. The difference is that SendMessage waits for the command to be taken in by the window. I use SendMessage instead of PostMessage. In addition of the post of "Jan Goyvaerts": While (!bExited & counter 0 & args.ToLower(CultureInfo.InvariantCulture).Equals("basic")))Ĭonsole.WriteLine("Setting to basic.") Įlse if (args.Length > 0 || args.ToLower(CultureInfo.InvariantCulture).Equals("aero")) P.StartInfo.WindowStyle = ProcessWindowStyle.Minimized Private String StartProcessAndWait(string filename, string arguments, int seconds, ref Boolean bExited) Private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam) Private static extern IntPtr FindWindow(string sClassName, string sAppName)
Windows 7 black glass theme full#
So starting from Mike's post above I cleaned things up, added comments, and will post full C# console app code:
Windows 7 black glass theme how to#
I know this is an old ticket, but somebody asked me how to do this today. This isn't a very elegant solution, but it does the job.
![windows 7 black glass theme windows 7 black glass theme](https://i.ytimg.com/vi/_EPiab94ABQ/maxresdefault.jpg)
The "Personalization" caption will likely be different on non-US-English versions of Windows.