Entrian Solutions
 

Drop shadows for non-rectangular windows: CS_DROPSHADOW and SetWindowRgn.

Saturday, June 14th, 2008 by

Windows has the ability to add a drop-shadow to windows – you see it on menus and tooltips, and you can easily apply it to your own windows via the CS_DROPSHADOW class style.

It also supports non-rectangular windows, via the Windows API SetWindowRgn.

Today I was pleasantly surprised to see that you can combine these two features and produce irregular windows with drop shadows, like this:

top-bar-with-drop-shadow.png

It’s not every day that Windows gives me a pleasant surprise, but today was one of those days. πŸ™‚

(I’m coding with MFC – if you’re wondering how to apply CS_DROPSHADOW to your MFC dialog, the answer is here: CodeGuru Forums: How to change the windows class name.)

Comments are closed.