{"id":108952,"date":"2023-11-01T07:00:00","date_gmt":"2023-11-01T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=108952"},"modified":"2023-11-01T06:47:55","modified_gmt":"2023-11-01T13:47:55","slug":"20231101-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20231101-00\/?p=108952","title":{"rendered":"More notes on use of the <CODE>DS_<WBR>CONTROL<\/CODE> style"},"content":{"rendered":"<p>Here&#8217;s a follow-up on some old articles on <a title=\"What is the DS_CONTROL style for?\" href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20040730-00\/?p=38293\"> the <code>DS_<wbr \/>CONTROL<\/code> dialog style<\/a> and <a title=\"When embedding a dialog inside another, make sure you don't accidentally create duplicate control IDs\" href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20120620-00\/?p=7333\"> avoiding accidental control ID collisions<\/a>.<\/p>\n<p>When you add the <code>DS_<wbr \/>CONTROL<\/code> style to your dialog template, there are other changes to the dialog styles which come into play. Some are mandatory, some are automatic, and some are optional.<\/p>\n<p><b>Mandatory<\/b>: You <i>must<\/i> remove the <code>WS_<wbr \/>POPUP<\/code> style and you <i>must<\/i> add the <code>WS_<wbr \/>CHILD<\/code> style. If you omit the <code>WS_<wbr \/>CHILD<\/code> style or accidentally specify the <code>WS_<wbr \/>POPUP<\/code> style, then the dialog won&#8217;t be created as a child window of the parent window you specified.<\/p>\n<p><b>Automatic<\/b>: You <i>may<\/i> remove the <code>WS_<wbr \/>CAPTION<\/code> and <code>WS_<wbr \/>SYS\u00adMENU<\/code> styles. The dialog manager removes them automatically, so this isn&#8217;t a requirement, but you are welcome to remove them yourself, either to avoid confusion or out of a sense of cleanliness.<\/p>\n<p><b>Optional<\/b>: You have the option of adding or removing the <code>WS_<wbr \/>VISIBLE<\/code> and <code>DS_<wbr \/>MODAL\u00adFRAME<\/code> styles, depending on the behavior you desire.<\/p>\n<p>If you specify <code>WS_<wbr \/>VISIBLE<\/code>, then the child dialog will be created visible. Otherwise, it will be created hidden.<\/p>\n<p>If you specify <code>DS_<wbr \/>MODAL\u00adFRAME<\/code>, then the child dialog gets the <code>WS_<wbr \/>EX_<wbr \/>WINDOW\u00adEDGE<\/code> extended style, which gives it an extra outer edge border. If you want the child dialog to blend in seamlessly with its parent, then you probably want to remove that style.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Styles that have to go in, and styles that have to come out. (And styles that you can choose.)<\/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-108952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Styles that have to go in, and styles that have to come out. (And styles that you can choose.)<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/108952","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=108952"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/108952\/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=108952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=108952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=108952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}