Glass Command Prompt in Windows 7
Dec 18, 2009
Everybody needs some glass in their life (or was it love? ) 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: Glassy.zip (34.05 kb)
- Download the source Glassy.zip (34.05 kb) and run Glassy\Debug\Glassy.exe, or compile and run. Run it as Administrator (right-click the .exe, Run as Administrator)
- Open command prompt and enjoy the glass!
- 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.
- Hook shell messages using RegisterWindowMessage(L"SHELLHOOK");
- Register your window with RegisterShellHookWindow(hWnd)
- Process the HSHELL_WINDOWCREATED message
- 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!