{"id":15763,"date":"2009-12-07T07:00:00","date_gmt":"2009-12-07T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2009\/12\/07\/what-is-the-story-behind-multimon-h\/"},"modified":"2009-12-07T07:00:00","modified_gmt":"2009-12-07T07:00:00","slug":"what-is-the-story-behind-multimon-h","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20091207-00\/?p=15763","title":{"rendered":"What is the story behind multimon.h?"},"content":{"rendered":"<p>Commenter asdf wonders <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/pages\/407234.aspx#705379\"> what the deal is with that <code>multimon.h<\/code> header file<\/a>.\n Let&#8217;s set some context. That header file was written back in the time when Windows&nbsp;98 was still under development. Windows&nbsp;98 was the first version of Windows to support multiple monitors. At the time, most application authors  had Windows&nbsp;95 as their target platform. And even after Windows&nbsp;98 shipped, the expectation was that programmers would target both Windows&nbsp;95 and Windows&nbsp;98 for at least a little while longer.\n The problem then is convincing programmers to write their code in a manner that works well in the face of multiple monitors. If you say, &#8220;Well, you need to call these functions, but only if running on a version of Windows which supports multiple monitors. If running on an older version of Windows, then you&#8217;ll need to keep doing things the old way because the functions you want to call don&#8217;t exist there.&#8221;\n Remember, if you want people to do something that doesn&#8217;t directly benefit them, you need to make it easy or they won&#8217;t bother. Therefore, the <code>multimon.h<\/code> header file was created which did the dirty work of checking whether it was running on a version of Windows which supported multiple monitors. If so, then it called those functions, and if not, then it emulated them. Applications could then use the <code>multimon.h<\/code> header file and write code on the assumption that the operating system supported multiple monitors: If it didn&#8217;t, then the stub functions in <code>multimon.h<\/code> would kick in and implement &#8220;fake multimonitor support&#8221;. For example, if you called <code>GetSystemMetrics(SM_CMONITORS)<\/code>, the stub function would simply return&nbsp;1. If you asked for <code>GetSystemMetrics(SM_CXVIRTUALSCREEN)<\/code>, the stub function just gave you the width of the (one) monitor.\n Of course, those old versions of Windows which don&#8217;t support multiple monitors are long obsolete, and there is no longer any need for the <code>multimon.h<\/code> header file. It long ago accomplished its intended goal. Give it a nice pat on the back.<\/p>\n<p> But the header file still lingers in the Platform&nbsp;SDK. If you have a program written back in the days when you couldn&#8217;t count on multiple monitor support, then removing that header file would result in a build break in your program. That wouldn&#8217;t be fun. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commenter asdf wonders what the deal is with that multimon.h header file. Let&#8217;s set some context. That header file was written back in the time when Windows&nbsp;98 was still under development. Windows&nbsp;98 was the first version of Windows to support multiple monitors. At the time, most application authors had Windows&nbsp;95 as their target platform. And [&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":[2],"class_list":["post-15763","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Commenter asdf wonders what the deal is with that multimon.h header file. Let&#8217;s set some context. That header file was written back in the time when Windows&nbsp;98 was still under development. Windows&nbsp;98 was the first version of Windows to support multiple monitors. At the time, most application authors had Windows&nbsp;95 as their target platform. And [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/15763","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=15763"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/15763\/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=15763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=15763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=15763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}