{"id":34653,"date":"2005-08-09T10:00:13","date_gmt":"2005-08-09T10:00:13","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2005\/08\/09\/the-dangers-of-messing-with-activation-when-handling-a-wm_activate-message\/"},"modified":"2005-08-09T10:00:13","modified_gmt":"2005-08-09T10:00:13","slug":"the-dangers-of-messing-with-activation-when-handling-a-wm_activate-message","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20050809-13\/?p=34653","title":{"rendered":"The dangers of messing with activation when handling a WM_ACTIVATE message"},"content":{"rendered":"<p>This is basically the same thing as <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2005\/08\/08\/448969.aspx\"> The dangers of playing focus games when handling a WM_KILLFOCUS message<\/a>, just with activation in place of focus. <a href=\"http:\/\/groups-beta.google.com\/group\/microsoft.public.win32.programmer.ui\/msg\/7c9071f8e9153be4\"> One developer discovered the hard way that if you mess with activation inside your WM_ACTIVATE handler, things get weird<\/a>. The author noted that if he posted a message and did the work from the posted message, then everything came out okay. <\/p>\n<p> <a href=\"http:\/\/groups-beta.google.com\/group\/microsoft.public.win32.programmer.ui\/msg\/79cfde5ecae9fd9a\"> A follow-up to the original message<\/a> noted that passing the <code>SWP_NOACTIVATE<\/code> flag to the <code>SetWindowPos<\/code> function solves the problem. Do you understand why? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is basically the same thing as The dangers of playing focus games when handling a WM_KILLFOCUS message, just with activation in place of focus. One developer discovered the hard way that if you mess with activation inside your WM_ACTIVATE handler, things get weird. The author noted that if he posted a message and did [&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-34653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>This is basically the same thing as The dangers of playing focus games when handling a WM_KILLFOCUS message, just with activation in place of focus. One developer discovered the hard way that if you mess with activation inside your WM_ACTIVATE handler, things get weird. The author noted that if he posted a message and did [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/34653","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=34653"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/34653\/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=34653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=34653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=34653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}