{"id":4193,"date":"2013-06-03T07:00:00","date_gmt":"2013-06-03T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2013\/06\/03\/how-do-i-make-it-more-difficult-for-somebody-to-take-a-screenshot-of-my-window\/"},"modified":"2013-06-03T07:00:00","modified_gmt":"2013-06-03T07:00:00","slug":"how-do-i-make-it-more-difficult-for-somebody-to-take-a-screenshot-of-my-window","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20130603-00\/?p=4193","title":{"rendered":"How do I make it more difficult for somebody to take a screenshot of my window?"},"content":{"rendered":"<p><P>\nUltimately,\nyou can&#8217;t stop somebody from ignoring the words\n<I>Confidential<\/I> at the top of a document and\n<A HREF=\"http:\/\/technet.microsoft.com\/en-us\/magazine\/hh241037.aspx\">\nwhipping out a digital camera\nand taking a picture of the screen<\/A>.\nBut at least\nstarting in Windows&nbsp;7\nyou can make it a little more difficult.\n<\/P>\n<P>\nTake our\n<A HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2003\/07\/23\/54576.aspx\">\nscratch program<\/A>\nand add this one line:\n<\/P>\n<PRE>\n    &#8230;\n    <FONT COLOR=\"blue\">SetWindowDisplayAffinity(hwnd, WDA_MONITOR);<\/FONT>\n    ShowWindow(hwnd, nShowCmd);\n    &#8230;\n<\/PRE>\n<P>\nAssuming you have the Desktop Window Manager enabled,\nyou will find that\nattempting to capture our scratch program in a screenshot\nor via the Snipping Tool\nwill result in black pixels.\n<\/P>\n<P>\nRemember, this is just an obstacle, not a security measure.\nIf somebody is determined to get the pixels,\nthis step is only going to slow them down a little.\n(For example,\non Windows&nbsp;7, they can simply disable the Desktop Window Manager.)\nBut it&#8217;s handy for reducing the likelihood of an accidental\nbreach of confidential information.\n<\/P>\n<P>\n<B>Pre-emptive hate<\/B>:\n&#8220;DRM is evil!&#8221;\nMy response to you: If you don&#8217;t like DRM,\nthen don&#8217;t buy DRM-protected content.\nIf you don&#8217;t like IRM,\nthen don&#8217;t read IRM-protected documents.\nIf you don&#8217;t like Blu-Ray,\nthen don&#8217;t buy Blu-Ray DVDs.\n<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ultimately, you can&#8217;t stop somebody from ignoring the words Confidential at the top of a document and whipping out a digital camera and taking a picture of the screen. But at least starting in Windows&nbsp;7 you can make it a little more difficult. Take our scratch program and add this one line: &#8230; SetWindowDisplayAffinity(hwnd, WDA_MONITOR); [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-4193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Ultimately, you can&#8217;t stop somebody from ignoring the words Confidential at the top of a document and whipping out a digital camera and taking a picture of the screen. But at least starting in Windows&nbsp;7 you can make it a little more difficult. Take our scratch program and add this one line: &#8230; SetWindowDisplayAffinity(hwnd, WDA_MONITOR); [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/4193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=4193"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/4193\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=4193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=4193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=4193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}