{"id":37773,"date":"2004-09-23T07:00:00","date_gmt":"2004-09-23T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2004\/09\/23\/how-to-host-an-icontextmenu-part-3-invocation-location\/"},"modified":"2004-09-23T07:00:00","modified_gmt":"2004-09-23T07:00:00","slug":"how-to-host-an-icontextmenu-part-3-invocation-location","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20040923-00\/?p=37773","title":{"rendered":"How to host an IContextMenu, part 3 &#8211; Invocation location"},"content":{"rendered":"<p><P>\nOne of the bugs you may have noticed in\n<A href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/09\/22\/232836.aspx\">\nour first attempt at displaying the context menu to the user<\/A>\nis that the Properties dialog doesn&#8217;t show up at the point you\nclicked.  The Properties dialog isn&#8217;t psychic; it doesn&#8217;t know\nwhere the original mouse click occurred.  You have to tell it.\n<\/P>\n<PRE>\n          CMINVOKECOMMANDINFOEX info = { 0 };\n          info.cbSize = sizeof(info);\n          info.fMask = CMIC_MASK_UNICODE <FONT COLOR=\"blue\">| CMIC_MASK_PTINVOKE<\/FONT>;\n          info.hwnd = hwnd;\n          info.lpVerb  = MAKEINTRESOURCEA(iCmd &#8211; SCRATCH_QCM_FIRST);\n          info.lpVerbW = MAKEINTRESOURCEW(iCmd &#8211; SCRATCH_QCM_FIRST);\n          info.nShow = SW_SHOWNORMAL;\n          <FONT COLOR=\"blue\">info.ptInvoke = pt;<\/FONT>\n<\/PRE>\n<P>\nYou tell it by setting the\nCMIC_MASK_PTINVOKE flag in the fMask and specifying the\ninvocation point in the ptInvoke member of\n<A HREF=\"http:\/\/msdn.microsoft.com\/library\/en-us\/shellcc\/platform\/shell\/reference\/structures\/cminvokecommandinfoex.asp\">\nthe CMINVOKECOMMANDINFOEX structure<\/A>.\n<\/P>\n<P>\nMake this change and observe that now the Properties dialog\nappears at the point you clicked the mouse rather than in a\nrandom location on the screen.\n<\/P>\n<P>\n<A href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/09\/24\/234113.aspx\">\nNext time<\/A>,\nwe&#8217;ll clean up another minor problem with our sample program.\n<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the bugs you may have noticed in our first attempt at displaying the context menu to the user is that the Properties dialog doesn&#8217;t show up at the point you clicked. The Properties dialog isn&#8217;t psychic; it doesn&#8217;t know where the original mouse click occurred. You have to tell it. CMINVOKECOMMANDINFOEX info = [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-37773","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>One of the bugs you may have noticed in our first attempt at displaying the context menu to the user is that the Properties dialog doesn&#8217;t show up at the point you clicked. The Properties dialog isn&#8217;t psychic; it doesn&#8217;t know where the original mouse click occurred. You have to tell it. CMINVOKECOMMANDINFOEX info = [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/37773","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=37773"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/37773\/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=37773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=37773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=37773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}