Glass Command Prompt in Windows 7

Dec 18, 2009

Everybody needs some glass in their life (or was it love? Smile) Anyway, here's a small project I did today out of love for glassy things.

This one is in pure C++, a completely glassy command prompt:

Source code: (34.05 kb)


  1. Download the source (34.05 kb) and run Glassy\Debug\Glassy.exe, or compile and run. Run it as Administrator (right-click the .exe, Run as Administrator)
  2. Open command prompt and enjoy the glass! 

Important Notes

  • The source code requires Visual Studio 2010 Beta2 - free download. Or, you can port it back manually to Visual Studio 2008
  • This project works on 32-bit executables only. If you're running on a 64-bit system, make sure to start C:\Windows\SysWOW64\cmd.exe, instead of your "other" cmd.exe 
  • The project will show only in task manager (no visible window). If you want to close it, open Task Manager, and end the Glassy.exe process

How is it made?

The application hooks into the shell and monitors all processed being created. Once it sees "cmd.exe", it enables the glass. It takes only 5 MB or RAM.

  1. Hook shell messages using RegisterWindowMessage(L"SHELLHOOK");
  2. Register your window with RegisterShellHookWindow(hWnd)
  3. Process the HSHELL_WINDOWCREATED message
  4. If you find the process being created to be "cmd.exe" (the command prompt), enable blur and extend it into the client area using DwmEnableBlurBehindWindow and DwmExtendFrameIntoClientArea

You're done! Also, you may try enabling transparent background for other applications as well, but I found it works best for cmd.exe

Just a little rest from WPF/Silverlight :)

Hope you like it! After all, what is life without love glass? Please comment!

blog comments powered by Disqus | Terms | Log in


About the author

Happy & enjoying life. Software enthusiast.
The opinions I express here and on are mine and not my employeer's (Microsoft).
This is the official blog of You can find Silverlight samples, coding stuff, and hopefully other interesting things here.