{"id":349,"date":"2009-08-11T21:12:05","date_gmt":"2009-08-11T19:12:05","guid":{"rendered":"http:\/\/mariusbancila.ro\/blog\/?p=349"},"modified":"2011-05-20T15:51:50","modified_gmt":"2011-05-20T13:51:50","slug":"file-dialog-with-custom-constrol","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/","title":{"rendered":"File Dialog with Custom Controls"},"content":{"rendered":"<p>Sometimes you want to customize a file dialog, maybe to provide a preview for images or files in general. Fortunately, the common file dialog can be easily extended to achieve this. I will explain in this post how to do that.<\/p>\n<p>There are several things one needs to do to extend the file dialog. First step is to create a dialog template. There are several properties (styles that have to be set on this template).<\/p>\n<ul>\n<li>WS_CHILD, necessary because this dialog is a child of the original file dialog<\/li>\n<li>WS_CLIPSIBLINGS, required so that the child dialog box does not paint over the original file dialog<\/li>\n<li>DS_3DLOOK, so that consistency of the look of the controls in the child dialog and the original dialog is preserved<\/li>\n<li>DS_CONTROL, allows the user to navigate through the controls of the customized dialog with TAB or navigation keys<\/li>\n<\/ul>\n<p>When using the template, the following should be done for the OPENFILENAME structure:<\/p>\n<ul>\n<li>if the template is a resource in an application or DLL library, then:\n<ul>\n<li><strong>Flags<\/strong> should contain OFN_ENABLETEMPLATE<\/li>\n<li><strong>hInstance<\/strong> must point to the module containing the resource<\/li>\n<li><strong>lpTemplateName<\/strong> should contain the template name<\/li>\n<\/ul>\n<\/li>\n<li>if the template is already in memory then\n<ul>\n<li><strong>Flags<\/strong> should contain OFN_ENABLETEMPLATEHANDLE<\/li>\n<li><strong>hInstance<\/strong> member must identify the memory object that contains the template<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The following code shows how to display a customized file dialog with a template with the ID set to &#8220;DIALOG_PREVIEW&#8221;:<\/p>\n<pre name=\"code\" class=\"cpp\">\r\n\tCFileDialog fileDialog(TRUE, NULL, NULL, OFN_HIDEREADONLY, _T(\"All files (*.*)|*.*||\"));\r\n\r\n\tfileDialog.m_ofn.Flags |= OFN_ENABLETEMPLATE;\r\n\tfileDialog.m_ofn.hInstance = AfxGetInstanceHandle();\r\n\tfileDialog.m_ofn.lpTemplateName = _T(\"DIALOG_PREVIEW\");\r\n\r\n\tfileDialog.DoModal();\r\n<\/pre>\n<p>The common file dialog is expanded on the sides so that the new controls have enough space. There are several rules that apply to this repositioning. I will explain them and exemplify with some images.<\/p>\n<ul>\n<li>By default all the controls from the custom dialog are placed below the controls from the original file dialog. The following images show a simple dialog template with a check box and a static control (for a preview). By default, these controls are placed at the bottom of the dialog.<br \/>\n<figure style=\"width: 180px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Simple dialog template\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/custompreviewtemplate1.png\" title=\"Simple dialog template\" width=\"190\" height=\"182\" \/><figcaption class=\"wp-caption-text\">Simple dialog template<\/figcaption><\/figure><br \/>\n<figure style=\"width: 551px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Custom dialog with preview controls placed at the bottom\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/customfiledialog1.png\" title=\"Custom Dialog with Preview\" width=\"561\" height=\"589\" \/><figcaption class=\"wp-caption-text\">Custom dialog with preview controls placed at the bottom<\/figcaption><\/figure>\n<\/li>\n<li>If the dialog template contains a static control with the id stc32 (defined in DLG.h), the controls will be positioned relative to this control (with the original dialog being displayed in its placed, in the original size).\n<ul>\n<li>all controls above and to the left of stc32 are positioned above and to the left of the original controls, with the same amount.<br \/>\n<figure style=\"width: 180px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Template with stc32 control position on the right and middle\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/custompreviewtemplate2.png\" title=\"Template with stc32 control\" width=\"190\" height=\"186\" \/><figcaption class=\"wp-caption-text\">Template with stc32 control position on the right and middle<\/figcaption><\/figure><br \/>\n<figure style=\"width: 718px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Custom File Fialog with Preview controls on the top left\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/customfiledialog2.png\" title=\"Custom File Dialog with Preview controls\" width=\"728\" height=\"580\" \/><figcaption class=\"wp-caption-text\">Custom File Fialog with Preview controls on the top left<\/figcaption><\/figure>\n<\/li>\n<li>all controls below and to the right of stc32 are positioned below and to the right of the original controls.<br \/>\n<figure style=\"width: 183px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Template with stc32 control position on the left and middle\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/custompreviewtemplate3.png\" title=\"Template with stc32 control\" width=\"193\" height=\"186\" \/><figcaption class=\"wp-caption-text\">Template with stc32 control position on the left and middle<\/figcaption><\/figure><br \/>\n<figure style=\"width: 721px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Custom File Fialog with Preview controls on the top and on the right\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/customfiledialog3.png\" title=\"Custom File Dialog with Preview controls\" width=\"731\" height=\"580\" \/><figcaption class=\"wp-caption-text\">Custom File Fialog with Preview controls on the top and on the right<\/figcaption><\/figure>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Base on that, if you want to place the preview controls on the right (as I would do), you&#8217;d have to place the stc32 control on the left of all the controls from your template. In other words, the template needs to look like this:<br \/>\n<figure style=\"width: 183px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Template with stc32 on the left of all controls\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/custompreviewtemplate4.png\" title=\"Template with stc32 on the left\" width=\"193\" height=\"186\" \/><figcaption class=\"wp-caption-text\">Template with stc32 on the left of all controls<\/figcaption><\/figure><\/p>\n<p>The resulting file dialog would look like this:<br \/>\n<figure style=\"width: 721px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" alt=\"Custom File Dialog with Preview Controls on the right side\" src=\"\/blog\/wp-content\/uploads\/2009\/08\/customfiledialog4.png\" title=\"Custom File Dialog with Preview Controls\" width=\"731\" height=\"440\" \/><figcaption class=\"wp-caption-text\">Custom File Dialog with Preview Controls on the right side<\/figcaption><\/figure><\/p>\n<p>Note: In the above images the stc32 control had the border style set one one hand to make the control visible on the dialog template and on the other hand to have the the original file dialog controls more visible within the resulting file dialog. You wouldn&#8217;t do that with an actual file dialog.<\/p>\n<p>As you could see from the sample code above, it&#8217;s very simple to extend the common file dialog. Of course, the part I haven&#8217;t shown so far is how to make use of these additional controls. But that is very simple. You just derive CFileDialog, add handlers for the new controls, implement all the logic you want, and instead of instantiating a CFileDialog object you instantiate an object of your derived class. In a following post I will explain how you can add preview functionality to such a custom file dialog.<\/p>\n<p>You can read more about this topic in the following articles:<\/p>\n<ul>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms646960%28VS.85%29.aspx\">Open and Save As Dialog Boxes<\/a><\/li>\n<li><a href=\"http:\/\/support.microsoft.com\/kb\/102332\">How to Show a Custom Common Dialog using CFileDialog<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you want to customize a file dialog, maybe to provide a preview for images or files in general. Fortunately, the common file dialog can be easily extended to achieve this. I will explain in this post how to do that. There are several things one needs to do to extend the file dialog. First &#8230; <a title=\"File Dialog with Custom Controls\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/\" aria-label=\"Read more about File Dialog with Custom Controls\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[7,12],"tags":[451,154,453,156,155],"class_list":["post-349","post","type-post","status-publish","format-standard","hentry","category-c","category-mfc","tag-c","tag-file-dialog","tag-mfc","tag-preview","tag-stc32"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"Learn how to customize a file dialog with custom controls.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"c++,file dialog,mfc,preview,stc32\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"File Dialog with Custom Controls\" \/>\n\t\t<meta property=\"og:description\" content=\"Learn how to customize a file dialog with custom controls.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-08-11T19:12:05+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2011-05-20T13:51:50+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"File Dialog with Custom Controls\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Learn how to customize a file dialog with custom controls.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#article\",\"name\":\"File Dialog with Custom Controls\",\"headline\":\"File Dialog with Custom Controls\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/08\\\/custompreviewtemplate1.png\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#articleImage\"},\"datePublished\":\"2009-08-11T21:12:05+02:00\",\"dateModified\":\"2011-05-20T15:51:50+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":3,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#webpage\"},\"articleSection\":\"C++, MFC, C++, file dialog, MFC, preview, stc32\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"position\":4,\"name\":\"C++\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/mfc\\\/#listItem\",\"name\":\"MFC\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/mfc\\\/#listItem\",\"position\":5,\"name\":\"MFC\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/mfc\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#listItem\",\"name\":\"File Dialog with Custom Controls\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#listItem\",\"position\":6,\"name\":\"File Dialog with Custom Controls\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/mfc\\\/#listItem\",\"name\":\"MFC\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/\",\"name\":\"File Dialog with Custom Controls\",\"description\":\"Learn how to customize a file dialog with custom controls.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2009\\\/08\\\/11\\\/file-dialog-with-custom-constrol\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2009-08-11T21:12:05+02:00\",\"dateModified\":\"2011-05-20T15:51:50+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"File Dialog with Custom Controls","description":"Learn how to customize a file dialog with custom controls.","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/","robots":"max-image-preview:large","keywords":"c++,file dialog,mfc,preview,stc32","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#article","name":"File Dialog with Custom Controls","headline":"File Dialog with Custom Controls","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-content\/uploads\/2009\/08\/custompreviewtemplate1.png","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#articleImage"},"datePublished":"2009-08-11T21:12:05+02:00","dateModified":"2011-05-20T15:51:50+02:00","inLanguage":"en-US","commentCount":3,"mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#webpage"},"articleSection":"C++, MFC, C++, file dialog, MFC, preview, stc32"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","position":4,"name":"C++","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/#listItem","name":"MFC"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/#listItem","position":5,"name":"MFC","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#listItem","name":"File Dialog with Custom Controls"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#listItem","position":6,"name":"File Dialog with Custom Controls","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/#listItem","name":"MFC"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/","name":"File Dialog with Custom Controls","description":"Learn how to customize a file dialog with custom controls.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2009-08-11T21:12:05+02:00","dateModified":"2011-05-20T15:51:50+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"File Dialog with Custom Controls","og:description":"Learn how to customize a file dialog with custom controls.","og:url":"https:\/\/mariusbancila.ro\/blog\/2009\/08\/11\/file-dialog-with-custom-constrol\/","article:published_time":"2009-08-11T19:12:05+00:00","article:modified_time":"2011-05-20T13:51:50+00:00","twitter:card":"summary","twitter:title":"File Dialog with Custom Controls","twitter:description":"Learn how to customize a file dialog with custom controls."},"aioseo_meta_data":{"post_id":"349","title":"File Dialog with Custom Controls","description":"Learn how to customize a file dialog with custom controls.","keywords":[{"label":"C++","value":"C++"},{"label":"file dialog","value":"file dialog"},{"label":"MFC","value":"MFC"},{"label":"preview","value":"preview"},{"label":"stc32","value":"stc32"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-18 21:14:52","updated":"2025-12-12 07:30:16","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":3,"uagb_excerpt":"Sometimes you want to customize a file dialog, maybe to provide a preview for images or files in general. Fortunately, the common file dialog can be easily extended to achieve this. I will explain in this post how to do that. There are several things one needs to do to extend the file dialog. First&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/\" class=\"advgb-post-tax-term\">MFC<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">MFC<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/\" class=\"advgb-post-tax-term\">file dialog<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/\" class=\"advgb-post-tax-term\">MFC<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/\" class=\"advgb-post-tax-term\">preview<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/mfc\/\" class=\"advgb-post-tax-term\">stc32<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">file dialog<\/span>","<span class=\"advgb-post-tax-term\">MFC<\/span>","<span class=\"advgb-post-tax-term\">preview<\/span>","<span class=\"advgb-post-tax-term\">stc32<\/span>"]}},"comment_count":"3","relative_dates":{"created":"Posted 17 years ago","modified":"Updated 15 years ago"},"absolute_dates":{"created":"Posted on August 11, 2009","modified":"Updated on May 20, 2011"},"absolute_dates_time":{"created":"Posted on August 11, 2009 9:12 pm","modified":"Updated on May 20, 2011 3:51 pm"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-5D","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":7,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":354,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/349\/revisions\/354"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}