{"id":44333,"date":"2015-04-01T07:00:00","date_gmt":"2015-04-01T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2015\/04\/01\/under-what-circumstances-will-a-dialog-box-not-use-the-caption-specified-in-the-resource-file\/"},"modified":"2019-03-13T12:14:19","modified_gmt":"2019-03-13T19:14:19","slug":"20150401-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20150401-00\/?p=44333","title":{"rendered":"Under what circumstances will a dialog box not use the caption specified in the resource file?"},"content":{"rendered":"<p>Could it be <a HREF=\"http:\/\/technet.microsoft.com\/en-us\/magazine\/jj203546.aspx\">space aliens<\/a>? <\/p>\n<blockquote CLASS=\"q\"><p>Under what circumstances will a dialog box not use the caption specified in the resource file? In particular, we have a modal dialog box that is not using the caption from the resource file. Even if we explicitly call <code>Set&shy;Window&shy;Text<\/code> from within the <code>WM_INIT&shy;DIALOG<\/code> handler, the call succeeds but the caption remains unchanged. <\/p><\/blockquote>\n<p>The dialog box&#8217;s initial title is the value specified in the resource template. And if you set it again in the <code>WM_INIT&shy;DIALOG<\/code> handler, then that new title overwrites the title from the resource template. Perhaps the problem is that some other code that runs after your <code>WM_INIT&shy;DIALOG<\/code> handler is changing the title yet again. <\/p>\n<p>The customer sheepishly wrote back, <\/p>\n<blockquote CLASS=\"q\">\n<p>[banging head against the wall] <\/p>\n<p>Being skeptical that there could ever be anything else overwriting the code I went to debug with Spy++. After some considerable effort I found out that yes, further down ~30 lines there&#8217;s a call to <code>Set&shy;Window&shy;Text<\/code>  that changes the title to something else. <\/p>\n<p>Thanks for making me look again. <\/p>\n<\/blockquote>\n<p><a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2005\/11\/30\/498399.aspx\">Sometimes the fault is not in our stars but in ourselves<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Who&#8217;s changing it?<\/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-44333","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Who&#8217;s changing it?<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/44333","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=44333"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/44333\/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=44333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=44333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=44333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}