{"id":36503,"date":"2005-02-08T07:00:00","date_gmt":"2005-02-08T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/02\/08\/what-other-effects-does-ds_shellfont-have-on-property-sheet-pages\/"},"modified":"2005-02-08T07:00:00","modified_gmt":"2005-02-08T07:00:00","slug":"what-other-effects-does-ds_shellfont-have-on-property-sheet-pages","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050208-00\/?p=36503","title":{"rendered":"What other effects does DS_SHELLFONT have on property sheet pages?"},"content":{"rendered":"<p>\nOnce you invent a new flag you can start using it to fix errors of the past\nwithout breaking backwards compatibility.\n<\/p>\n<p>\nOne of the errors of the past was that property sheet page dimensions\nwere taken relative to the &#8220;MS Sans Serif&#8221; font, even if the page\nused some other font.\n<\/p>\n<pre>\nDLG_SAMPLE DIALOGEX 32, 32, 212, 188\nCAPTION \"Caption\"\nFONT \"Lucida Sans Unicode\"\n...\n<\/pre>\n<p>\nThis sample dialog template says that it is 212dlu wide and 188dlu tall.\nIf the dialog template were used for a standalone dialog, those\nDLU values would be calculated relative to the font on the dialog,\nnamely Lucida Sans Unicode.\n<\/p>\n<p>\nHowever, if the dialog template were used for a property sheet page,\nearlier versions of Windows would interpret the values\n212 and 188 relative to the font of the\n<strong>property sheet frame<\/strong> (usually MS Sans Serif),\nnot relative to the font associated with the page itself.\nMany people worked around this problem by giving their pages\npre-adjusted sizes, so that when Windows measured the dialog against\nMS Sans Serif, the adjustments cancelled out.\n<\/p>\n<p>\nIn other words, suppose that Lucida Sans Unicode is 25% wider\nthan MS Sans Serif.  (I&#8217;m just making up numbers.)\nThen to get a 212dlu-wide dialog relative to Lucida Sans Unicode,\nthe dialog template would specify a width of\n212dlu + 25% = 265dlu.\n<\/p>\n<p>\nSince people were now relying on this behavior, it couldn&#8217;t be\nchanged.  If you went in and &#8220;fixed&#8221; it, all those pre-adjusted\ndialogs would come out at the wrong size.\n<\/p>\n<p>\nAh, but now there is a new flag, <code>DS_SHELLFONT<\/code>.\nStarting in Windows&nbsp;2000, if you specify the\n<code>DS_SHELLFONT<\/code> dialog style for your <code>DIALOGEX<\/code>\ndialog template, then the dialog dimensions are taken relative to\nthe font you specified in your template\n(<a HREF=\"http:\/\/groups-beta.google.com\/group\/comp.os.ms-windows.programmer.controls\/msg\/87e77f5b7818cfd7\">which is probably what you wanted<\/a>)\nrather than relative to the property sheet frame font.\nIf you leave off the flag (as older programs will), then the\nproperty sheet measurement code remains bug-for-bug compatible\nwith previous versions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you invent a new flag you can start using it to fix errors of the past without breaking backwards compatibility. One of the errors of the past was that property sheet page dimensions were taken relative to the &#8220;MS Sans Serif&#8221; font, even if the page used some other font. DLG_SAMPLE DIALOGEX 32, 32, [&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,2],"class_list":["post-36503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code","tag-history"],"acf":[],"blog_post_summary":"<p>Once you invent a new flag you can start using it to fix errors of the past without breaking backwards compatibility. One of the errors of the past was that property sheet page dimensions were taken relative to the &#8220;MS Sans Serif&#8221; font, even if the page used some other font. DLG_SAMPLE DIALOGEX 32, 32, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/36503","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=36503"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/36503\/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=36503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=36503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=36503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}