{"id":99745,"date":"2018-09-17T07:00:00","date_gmt":"2018-09-17T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=99745"},"modified":"2021-01-10T19:59:34","modified_gmt":"2021-01-11T03:59:34","slug":"20180917-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20180917-00\/?p=99745","title":{"rendered":"What defines an old-style common dialog?"},"content":{"rendered":"<p>In the documentation for the <code>OPEN\u00adFILE\u00adNAME<\/code> structure, there are many references to &#8220;old-style&#8221; dialogs. What is an old-style dialog, how do you get one, and how is it different from a new-style dialog?<\/p>\n<p>So-called &#8220;old-style&#8221; dialogs are the File Open and File Save dialogs from Windows 3.1. Here&#8217;s roughly what they looked like:<\/p>\n<div>\n<table style=\"background-color: #c0c0c0; color: black; border: outset 2px; border-color: white #c0c0c0 #c0c0c0 white; padding: 1px; width: 30pc; font-family: MS Sans Serif, sans-serif; font-size: 10pt; line-height: normal;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"color: white; text-align: left; padding: .5ex;\" colspan=\"7\" bgcolor=\"#000080\"><b>Open<\/b><\/td>\n<\/tr>\n<tr style=\"height: 1ex;\">\n<td style=\"padding: 0;\" colspan=\"7\"><!--\u00a0--><\/td>\n<\/tr>\n<tr style=\"background-color: #c0c0c0;\">\n<td style=\"width: 1ex; padding: 0;\"><!--\u00a0--><\/td>\n<td style=\"padding: 0;\">File <u>n<\/u>ame:<\/td>\n<td style=\"width: 1ex; padding: 0;\"><!--\u00a0--><\/td>\n<td style=\"padding: 0;\"><u>F<\/u>olders:<\/td>\n<td style=\"width: 1ex; padding: 0;\"><!-- --><\/td>\n<td style=\"width: 13ex; padding: 0;\" rowspan=\"3\"><!-- NOTE ANGLE BRACKET PLACEMENT to avoid WordPress inserting \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<P><\/P>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n (it even mangles this comment) --><\/p>\n<div style=\"border: solid 1px black;\">\n<div style=\"border: solid 1px; border-color: white #808080 #808080 white; text-align: center; padding: .5ex;\">OK<\/div>\n<\/div>\n<div style=\"height: 1ex;\">\u00a0<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0; text-align: center; padding: .5ex;\">Cancel<\/div>\n<\/div>\n<\/td>\n<td style=\"width: 1ex;\">\u00a0<\/td>\n<\/tr>\n<tr style=\"background-color: #c0c0c0;\">\n<td>&nbsp;<\/td>\n<td>\n<div style=\"border: solid 1px; border-color: #808080 white white #808080;\">\n<div style=\"border: solid 1px; border-color: black #c0c0c0 #c0c0c0 black; background-color: white; padding: 1px;\">file.txt<\/div>\n<\/div>\n<\/td>\n<td>&nbsp;<\/td>\n<td>C:\\WINDOWS<\/td>\n<td colspan=\"3\">\u00a0<\/td>\n<\/tr>\n<tr style=\"height: 1ex; background-color: #c0c0c0;\">\n<td style=\"padding: 0;\" colspan=\"7\"><!--\u00a0--><\/td>\n<\/tr>\n<tr style=\"background-color: #c0c0c0;\">\n<td>&nbsp;<\/td>\n<td style=\"border: solid 1px; border-color: #808080 white white #808080; padding: 0;\">\n<div style=\"display: grid; grid: auto \/ 1fr auto; background-color: white; border: solid 1px; border-color: black #c0c0c0 #c0c0c0 black;\">\n<div style=\"height: 90px; overflow: hidden;\">CONFIG.TXT<br \/>\nDISPLAY.TXT<br \/>\nEXCHANGE.TXT<br \/>\nEXTRA.TXT<br \/>\nFAQ.TXT<br \/>\nGENERAL.TXT<\/div>\n<div style=\"height: 90px; display: grid; grid: auto 2fr 3fr auto \/ auto; text-align: center; background-color: #c0c0c0;\">\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u25b4<\/div>\n<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u00a0<\/div>\n<\/div>\n<div style=\"background-color: #e0e0e0;\">\u00a0<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u25be<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/td>\n<td style=\"padding: 0;\">\u00a0<\/td>\n<td style=\"padding: 0;\">\n<div style=\"display: grid; grid: auto \/ 1fr auto; background-color: white; border: solid 1px; border-color: black #c0c0c0 #c0c0c0 black;\">\n<div style=\"height: 90px; overflow: hidden;\">\ud83d\udcc1 C:\\<br \/>\n\u00a0\ud83d\udcc1 WINDOWS<br \/>\n\u00a0\u00a0\ud83d\udcc1COMMAND<br \/>\n\u00a0\u00a0\ud83d\udcc1CONFIG<br \/>\n\u00a0\u00a0\ud83d\udcc1CURSORS<br \/>\n\u00a0\u00a0\ud83d\udcc1Desktop<\/div>\n<div style=\"height: 90px; display: grid; grid: auto 2fr 3fr auto \/ auto; text-align: center; background-color: #c0c0c0;\">\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u25b4<\/div>\n<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u00a0<\/div>\n<\/div>\n<div style=\"background-color: #e0e0e0;\">\u00a0<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u25be<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/td>\n<td colspan=\"3\">\u00a0<\/td>\n<\/tr>\n<tr style=\"height: 1ex; background-color: #c0c0c0;\">\n<td style=\"padding: 0;\" colspan=\"7\"><!--\u00a0--><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 0;\">\u00a0<\/td>\n<td style=\"padding: 0;\">List files of <u>t<\/u>ype:<\/td>\n<td style=\"padding: 0;\">\u00a0<\/td>\n<td style=\"padding: 0;\">Dri<u>v<\/u>es:<\/td>\n<td style=\"padding: 0;\">\u00a0<\/td>\n<td style=\"padding: 0;\" colspan=\"2\">\u00a0<\/td>\n<\/tr>\n<tr style=\"height: 1ex; background-color: #c0c0c0;\">\n<td style=\"padding: 0;\" colspan=\"7\"><!--\u00a0--><\/td>\n<\/tr>\n<tr>\n<td style=\"padding: 0;\">\u00a0<\/td>\n<td style=\"border: solid 1px; border-color: #808080 white white #808080; padding: 0;\">\n<div style=\"display: grid; grid: auto \/ 1fr auto; border: solid 1px; border-color: black #c0c0c0 #c0c0c0 black;\">\n<div style=\"background-color: white; padding: 1px;\">Text files (*.txt)<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u25be<\/div>\n<\/div>\n<\/div>\n<\/td>\n<td style=\"padding: 0;\">\u00a0<\/td>\n<td style=\"border: solid 1px; border-color: #808080 white white #808080; padding: 0;\">\n<div style=\"display: grid; grid: auto \/ 1fr auto; border: solid 1px; border-color: black #c0c0c0 #c0c0c0 black;\">\n<div style=\"background-color: white; padding: 1px;\">\ud83d\uddb4 C:<\/div>\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #c0c0c0 #808080 #808080 #c0c0c0;\">\u25be<\/div>\n<\/div>\n<\/div>\n<\/td>\n<td style=\"padding: 0;\" colspan=\"3\">\u00a0<\/td>\n<\/tr>\n<tr style=\"height: 1ex; background-color: #c0c0c0;\">\n<td style=\"padding: 0;\" colspan=\"7\"><!--\u00a0--><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>These are not the &#8220;new&#8221; style dialogs that resemble an Explorer window. They are the old-fashioned dialogs that scream &#8220;I was written in the early 1990s!&#8221;<\/p>\n<p>When you use an old-style dialog, Windows basically uses the code that was originally written for Windows 3.1, because programs from that era don&#8217;t support fancy things like long file names, and when they try to customize the dialog, they are expecting to customize a Windows 3.1-style dialog, so that&#8217;s what we give them.<\/p>\n<p>Here are the main differences between the old style and new style dialogs:<\/p>\n<table class=\"cp3\" style=\"border-collapse: collapse;\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n<tbody>\n<tr>\n<th>Feature<\/th>\n<th>Old-style<\/th>\n<th>New-style<\/th>\n<\/tr>\n<tr>\n<td>Long file names<\/td>\n<td>No<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Resizability<\/td>\n<td>Not resizable<\/td>\n<td>Resizable<\/td>\n<\/tr>\n<tr>\n<td>Multiselect<\/td>\n<td>Space-separated file names<\/td>\n<td>Null-separated file names<\/td>\n<\/tr>\n<tr>\n<td>Template<\/td>\n<td>Replaces entire dialog<\/td>\n<td>Embedded into existing dialog<\/td>\n<\/tr>\n<tr>\n<td>Default extension<\/td>\n<td>Maximum 3 characters<\/td>\n<td>Can exceed 3 characters<\/td>\n<\/tr>\n<tr>\n<td>Hooks<\/td>\n<td>Windows 3.1-style<\/td>\n<td>Windows 95-style<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The system decides whether you get an old-style or new-style dialog based on the following rules:<\/p>\n<ul>\n<li>If you say <code>OFN_<wbr \/>EXPLORER<\/code>, then you get a new-style dialog.<\/li>\n<li>If you don&#8217;t say <code>OFN_<wbr \/>EXPLORER<\/code>, and you do say <code>OFN_<code><\/code>ENABLE\u00adTEMPLATE<\/code>, <code>OFN_<code><\/code>ENABLE\u00adTEMPLATE\u00adHANDLE<\/code>, <code>OFN_<code><\/code>ENABLE\u00adHOOK<\/code>, or <code>OFN_<code><\/code>ALLOW\u00adMULTI\u00adSELECT<\/code>, then you get an old-style dialog.<\/li>\n<li>If you don&#8217;t say anything on the above list, then you get a new-style dialog.<\/li>\n<\/ul>\n<p>In words: You get an old-style dialog if you ask for any of <code>OFN_<code><\/code>ENABLE\u00adTEMPLATE<\/code>, <code>OFN_<code><\/code>ENABLE\u00adTEMPLATE\u00adHANDLE<\/code>, <code>OFN_<code><\/code>ENABLE\u00adHOOK<\/code>, or <code>OFN_<code><\/code>ALLOW\u00adMULTI\u00adSELECT<\/code>, since those are the things that affect the programmatic behavior of the dialog. However, you can override this by saying <code>OFN_<wbr \/>EXPLORER<\/code> to say, &#8220;No really, I&#8217;m okay with the new hotness.&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Going back into the Before Time.<\/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-99745","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Going back into the Before Time.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/99745","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=99745"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/99745\/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=99745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=99745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=99745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}