{"id":36513,"date":"2005-02-07T07:00:00","date_gmt":"2005-02-07T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/02\/07\/why-does-ds_shellfont-ds_fixedsys-ds_setfont\/"},"modified":"2005-02-07T07:00:00","modified_gmt":"2005-02-07T07:00:00","slug":"why-does-ds_shellfont-ds_fixedsys-ds_setfont","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050207-00\/?p=36513","title":{"rendered":"Why does DS_SHELLFONT = DS_FIXEDSYS &#124; DS_SETFONT?"},"content":{"rendered":"<p>\nYou may have noticed that the numerical value of the\n<code>DS_SHELLFONT<\/code> flag is equal to\n<code>DS_FIXEDSYS | DS_SETFONT<\/code>.\n<\/p>\n<pre>\n#define DS_SETFONT          0x40L   \/* User specified font for Dlg controls *\/\n#define DS_FIXEDSYS         0x0008L\n#define DS_SHELLFONT        (DS_SETFONT | DS_FIXEDSYS)\n<\/pre>\n<p>\nSurely that isn&#8217;t a coincidence.\n<\/p>\n<p>\nThe value of the <code>DS_SHELLFONT<\/code> flag was chosen so that\nolder operating systems (Windows&nbsp;95, 98, NT&nbsp;4) would\naccept the flag while nevertheless ignoring it.\nThis allowed people to write a single program\nthat got the &#8220;Windows&nbsp;2000&#8221; look\nwhen running on Windows&nbsp;2000 and got the &#8220;classic&#8221; look when\nrunning on older systems.\n(If you make people have to write two versions of their program,\none that runs on all systems and one that runs only on the newer\nsystem and looks slightly cooler,\nthey will usually not bother writing the second one.)\n<\/p>\n<p>\nThe <code>DS_FIXEDSYS<\/code> flag met these conditions.\nOlder systems accepted the flag since it was indeed a valid flag,\nbut they also ignored it because the <code>DS_SETFONT<\/code> flag\ntakes precedence.\n<\/p>\n<p>\nThis is one of those backwards-compatibility exercises:\nHow do you design something so that it\nis possible to write one program that\ngets the new features on new systems while at the same time\ndegrading gracefully on old systems?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may have noticed that the numerical value of the DS_SHELLFONT flag is equal to DS_FIXEDSYS | DS_SETFONT. #define DS_SETFONT 0x40L \/* User specified font for Dlg controls *\/ #define DS_FIXEDSYS 0x0008L #define DS_SHELLFONT (DS_SETFONT | DS_FIXEDSYS) Surely that isn&#8217;t a coincidence. The value of the DS_SHELLFONT flag was chosen so that older operating systems [&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-36513","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>You may have noticed that the numerical value of the DS_SHELLFONT flag is equal to DS_FIXEDSYS | DS_SETFONT. #define DS_SETFONT 0x40L \/* User specified font for Dlg controls *\/ #define DS_FIXEDSYS 0x0008L #define DS_SHELLFONT (DS_SETFONT | DS_FIXEDSYS) Surely that isn&#8217;t a coincidence. The value of the DS_SHELLFONT flag was chosen so that older operating systems [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/36513","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=36513"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/36513\/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=36513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=36513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=36513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}