{"id":34993,"date":"2005-07-08T10:00:21","date_gmt":"2005-07-08T10:00:21","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/07\/08\/how-can-i-recover-the-dialog-resource-id-from-a-dialog-window-handle\/"},"modified":"2005-07-08T10:00:21","modified_gmt":"2005-07-08T10:00:21","slug":"how-can-i-recover-the-dialog-resource-id-from-a-dialog-window-handle","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050708-21\/?p=34993","title":{"rendered":"How can I recover the dialog resource ID from a dialog window handle?"},"content":{"rendered":"<p>Occasionally, I see someone ask a question like the following.<\/p>\n<blockquote class=\"m\"><p> I have the handle to a dialog window. How can I get the original dialog resource ID that the dialog was created from? <\/p><\/blockquote>\n<p> As we saw in our <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/06\/18\/159248.aspx\"> in-depth discussion of how dialogs are created from dialog templates<\/a>, the dialog template itself is not saved anywhere. The purpose of a template is to act as the&#8230; well&#8230; &#8220;template&#8221; for creating a dialog box. Once the dialog box has been created, there is no need for the template any more. Consequently, there is no reason why the system should remember it. <\/p>\n<p> Besides, if <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2005\/04\/29\/412577.aspx\"> the dialog were created from a runtime-generated template<\/a>, saving the original parameters would leave pointers to freed memory. Furthermore, the code that created the dialog box almost certainly modified the dialog box during its <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/winui\/winui\/windowsuserinterface\/windowing\/dialogboxes\/dialogboxreference\/dialogboxmessages\/wm_initdialog.asp\"> <code>WM_INITDIALOG<\/code> message<\/a> processing (filling list boxes with data, maybe enabling or disabling some buttons), so the dialog box you see on screen doesn&#8217;t correspond to a template anywhere. <\/p>\n<p> It&#8217;s like asking, &#8220;Given a plate of food, how do I recover the original cookbook and page number for the recipe?&#8221; By doing a chemical analysis of the food, you might be able to recover &#8220;a&#8221; recipe, but there is nothing in the food itself that says, &#8220;I came from The Joy of Cooking, page 253.&#8221; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Occasionally, I see someone ask a question like the following. I have the handle to a dialog window. How can I get the original dialog resource ID that the dialog was created from? As we saw in our in-depth discussion of how dialogs are created from dialog templates, the dialog template itself is not saved [&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":[26],"class_list":["post-34993","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>Occasionally, I see someone ask a question like the following. I have the handle to a dialog window. How can I get the original dialog resource ID that the dialog was created from? As we saw in our in-depth discussion of how dialogs are created from dialog templates, the dialog template itself is not saved [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/34993","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=34993"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/34993\/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=34993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=34993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=34993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}