{"id":111211,"date":"2025-05-22T07:00:00","date_gmt":"2025-05-22T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=111211"},"modified":"2025-05-22T07:28:21","modified_gmt":"2025-05-22T14:28:21","slug":"20250522-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20250522-00\/?p=111211","title":{"rendered":"How can I create a window the size of the screen without it being treated as a fullscreen window?"},"content":{"rendered":"<p>The taskbar allows fullscreen windows to cover it. That way, when you are projecting a slide show or making a presentation, you don&#8217;t have a taskbar at the bottom. The autodetection algorithm works fairly well most of the time: If the client area covers the entire screen, then it is a fullscreen window.<\/p>\n<p>But you may find that the taskbar sometimes treats your window as a fullscreen window when you didn&#8217;t mean it to, or it fails to treat your window as fullscreen when you intended it to.<\/p>\n<p>One case where you don&#8217;t want your screen-sized window to be treated as a fullscreen window is if your window is trying to apply an effect to the screen, like showing a 50% opacity black window in order to apply a dimming effect, such as that used by the <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/powertoys\/mouse-utilities\"> Find My Mouse PowerToy<\/a>. And a case where you want to force your screen-sized window to be treated as a fullscreen window is if you have a caption, because the caption is nonclient, and the fullscreen calculations look only at the client area.<\/p>\n<p>You have two ways to influence the decision, both documented <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/shobjidl_core\/nf-shobjidl_core-itaskbarlist2-markfullscreenwindow\"> on the same page<\/a>: One is to use <code>ITaskbar\u00adList2::<wbr \/>Mark\u00adFullscreen\u00adWindow<\/code>, and another is to use the <code>NonRudeHWND<\/code> window property.<\/p>\n<p>The two settings are somewhat complementary in that each one tugs the Taskbar in different directions.<\/p>\n<p>If you pass <code>TRUE<\/code> to <code>ITaskbar\u00adList2::<wbr \/>Mark\u00adFullscreen\u00adWindow<\/code>, then you are declaring that your window is a fullscreen window.\u00b9 If you pass <code>FALSE<\/code>, then you are canceling this declaration. Note that passing <code>FALSE<\/code> does not mean &#8220;I am declaring that this is not a fullscreen window.&#8221; Rather, it means &#8220;I am not declaring that this is a fullscreen window.&#8221;<\/p>\n<p>You can call <code>Mark\u00adFullscreen\u00adWindow<\/code> before showing the window, or you can do it while the window is already shown, in which case it takes effect immediately. However, once you hide the window, any setting you applied is lost. If you want it to carry forward to the next time the window is shown, you need to set it again. The marking is also lost if Explorer crashes, so listen for the <code>TaskbarCreated<\/code> message and reapply your marking.<\/p>\n<p>The <code>NonRudeHWND<\/code> property is consulted when the window is shown or when the system detects that your window might be a fullscreen window (like when it changes size to cover the screen). Changing the value after the decision has been made has no effect until the system needs to make a new decision, such as if you hide your window and then show it again. If the <code>NonRudeHWND<\/code> property is set to <code>1<\/code>, then you are declaring that your window is definitely not a fullscreen window. Removing the property does not force your window to be treated as a fullscreen window; rather, it means &#8220;Just continue with your normal fullscreen detection logic.&#8221;<\/p>\n<p>I&#8217;ll summarize in a table.<\/p>\n<table class=\"cp3\" style=\"border-collapse: collapse; text-align: center;\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n<tbody>\n<tr>\n<th>\u00a0<\/th>\n<th>MarkFullscreenWindow<\/th>\n<th>NonRudeHWND<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Effect if set<\/td>\n<td>Window is treated as fullscreen<\/td>\n<td>Window is treated as non-fullscreen<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Best time to call<\/td>\n<td colspan=\"2\">Before showing or resizing window<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">How often to call<\/td>\n<td>Each time you show the window<\/td>\n<td>Once is enough<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">If changed while visible<\/td>\n<td>Takes effect<\/td>\n<td>Nothing happens<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">If TaskbarCreated<\/td>\n<td>Call it again<\/td>\n<td>Don&#8217;t need to<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00b9 The window still has to meet some basic criteria like, y&#8217;know, actually covering the screen. You can&#8217;t create a little 1\u00d71 window and declare &#8220;I am a fullscreen window!&#8221;<\/p>\n<p>Well, I mean you could, but people would just laugh at you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can declare that you aren&#8217;t rude.<\/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-111211","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>You can declare that you aren&#8217;t rude.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/111211","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=111211"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/111211\/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=111211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=111211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=111211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}