{"id":41703,"date":"2003-11-26T07:00:00","date_gmt":"2003-11-26T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2003\/11\/26\/other-tricks-with-wm_getdlgcode\/"},"modified":"2003-11-26T07:00:00","modified_gmt":"2003-11-26T07:00:00","slug":"other-tricks-with-wm_getdlgcode","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20031126-00\/?p=41703","title":{"rendered":"Other tricks with WM_GETDLGCODE"},"content":{"rendered":"<p>The WM_GETDLCODE message lets you influence the behavior of the dialog manager. <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2003\/11\/14\/55678.aspx\"> A previous entry on using WM_GETDLGCODE<\/a> described the <code>DLGC_HASSETSEL<\/code> flag which controls whether edit control content is auto-selected when focus changes.\n I was going to write a bit about the other flags, but it turns out that <a href=\"http:\/\/support.microsoft.com\/support\/kb\/articles\/Q83\/3\/02.ASP\"> Knowledge Base Article 83302<\/a> already covers this, so I&#8217;ll just call out some highlights.\n The <code>DLGC_WANTMESSAGE<\/code> flag is the most powerful one. It lets your control prevent the dialog manager from handling a message.  So for example if you don&#8217;t want ESC to dismiss the dialog box when focus is on a particular control but rather be delivered to the control itself, handle the <code>WM_GETDLGCODE<\/code> message and peek at the <code>lParam<\/code>. If it is a press of the ESC key, then return <code>DLGC_WANTMESSAGE<\/code> so the message will not be handled by the dialog manager.\n The <code>DLGC_WANTCHARS<\/code>, <code>DLGC_WANTTAB<\/code> and <code>DLGC_WANTARROWS<\/code> flags are just conveniences that save you the trouble of checking certain categories of messages.<\/p>\n<p> As always, consider the consequences of overriding default behavior. Doing so generally makes your program harder to use, since it goes against what people are accustomed to seeing in other programs.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The WM_GETDLCODE message lets you influence the behavior of the dialog manager. A previous entry on using WM_GETDLGCODE described the DLGC_HASSETSEL flag which controls whether edit control content is auto-selected when focus changes. I was going to write a bit about the other flags, but it turns out that Knowledge Base Article 83302 already covers [&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],"class_list":["post-41703","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>The WM_GETDLCODE message lets you influence the behavior of the dialog manager. A previous entry on using WM_GETDLGCODE described the DLGC_HASSETSEL flag which controls whether edit control content is auto-selected when focus changes. I was going to write a bit about the other flags, but it turns out that Knowledge Base Article 83302 already covers [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41703","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=41703"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41703\/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=41703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=41703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=41703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}