{"id":20,"date":"2008-06-14T00:30:23","date_gmt":"2008-06-13T23:30:23","guid":{"rendered":"http:\/\/entrian.com\/blog\/drop-shadows-for-non-rectangular-windows-cs_dropshadow-and-setwindowrgn\/"},"modified":"2021-07-01T07:13:43","modified_gmt":"2021-07-01T07:13:43","slug":"drop-shadows-for-non-rectangular-windows-cs_dropshadow-and-setwindowrgn","status":"publish","type":"post","link":"https:\/\/entrian.com\/blog\/drop-shadows-for-non-rectangular-windows-cs_dropshadow-and-setwindowrgn\/","title":{"rendered":"Drop shadows for non-rectangular windows: CS_DROPSHADOW and SetWindowRgn."},"content":{"rendered":"<p>Windows has the ability to add a drop-shadow to windows &#8211; you see it on menus and tooltips, and you can easily apply it to your own windows via the <strong>CS_DROPSHADOW<\/strong> class style.<\/p>\n<p>It also supports non-rectangular windows, via the Windows API <strong>SetWindowRgn<\/strong>.<\/p>\n<p>Today I was pleasantly surprised to see that you can combine these two features and produce irregular windows with drop shadows, like this:<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/entrian.com\/blog\/wp-content\/uploads\/2008\/06\/top-bar-with-drop-shadow.png\" alt=\"top-bar-with-drop-shadow.png\" vspace=\"10\" \/><\/p>\n<p>It&#8217;s not every day that Windows gives me a pleasant surprise, but today was one of those days.  \ud83d\ude42<\/p>\n<p>(I&#8217;m coding with MFC &#8211; if you&#8217;re wondering how to apply CS_DROPSHADOW to your MFC dialog, the answer is here: <a href=\"http:\/\/www.codeguru.com\/forum\/showthread.php?t=363229\">CodeGuru Forums: How to change the windows class name<\/a>.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows has the ability to add a drop-shadow to windows &#8211; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-30days"],"_links":{"self":[{"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":1215,"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions\/1215"}],"wp:attachment":[{"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entrian.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}