{"id":29623,"date":"2006-09-22T10:00:03","date_gmt":"2006-09-22T10:00:03","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2006\/09\/22\/things-you-already-know-how-do-i-wait-until-my-dialog-box-is-displayed-before-doing-something\/"},"modified":"2006-09-22T10:00:03","modified_gmt":"2006-09-22T10:00:03","slug":"things-you-already-know-how-do-i-wait-until-my-dialog-box-is-displayed-before-doing-something","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20060922-03\/?p=29623","title":{"rendered":"Things you already know: How do I wait until my dialog box is displayed before doing something?"},"content":{"rendered":"<p>\nOne customer wanted to wait until the dialog box was displayed\nbefore displaying its own dialog box.\n(Personally, I think immediately displaying\na doubly-nested dialog box counts as starting off on the wrong foot\nfrom a usability standpoint,\nbut let&#8217;s set that issue aside for now.)\nThe customer discovered that displaying the nested dialog box\nin response to the <code>WM_INITDIALOG<\/code> message was premature,\nbecause as we all know,\n<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/03\/11\/87941.aspx\">\nthe <code>WM_INITDIALOG<\/code> is sent\nbefore the dialog box is displayed<\/a>.\nThe question therefore is,\n&#8220;How do I want until my dialog box is displayed before doing something?&#8221;\n<\/p>\n<p>\nOne proposed solution was the following code fragment:\n<\/p>\n<pre>\ncase WM_INITDIALOG:\n    PostMessage(hDlg, WM_APP, 0, 0);\n    return TRUE;\ncase WM_APP:\n    ... display the second dialog ...\n    break;\n<\/pre>\n<ol>\n<li>Why is this wrong?\n    Hint: You definitely know the answer to this already.<\/p>\n<li>What is the correct solution?\n    You probably know this already.\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>One customer wanted to wait until the dialog box was displayed before displaying its own dialog box. (Personally, I think immediately displaying a doubly-nested dialog box counts as starting off on the wrong foot from a usability standpoint, but let&#8217;s set that issue aside for now.) The customer discovered that displaying the nested dialog box [&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-29623","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>One customer wanted to wait until the dialog box was displayed before displaying its own dialog box. (Personally, I think immediately displaying a doubly-nested dialog box counts as starting off on the wrong foot from a usability standpoint, but let&#8217;s set that issue aside for now.) The customer discovered that displaying the nested dialog box [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/29623","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=29623"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/29623\/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=29623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=29623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=29623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}