{"id":37213,"date":"2004-11-24T07:00:00","date_gmt":"2004-11-24T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2004\/11\/24\/why-cant-you-drop-directly-onto-a-taskbar-button\/"},"modified":"2004-11-24T07:00:00","modified_gmt":"2004-11-24T07:00:00","slug":"why-cant-you-drop-directly-onto-a-taskbar-button","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20041124-00\/?p=37213","title":{"rendered":"Why can&#8217;t you drop directly onto a taskbar button?"},"content":{"rendered":"<p><P>\nIf you drag a object and drop it onto a taskbar button, you get\nan error message that says,\n<\/P>\n<BLOCKQUOTE CLASS=\"m\">\n<P>\nYou cannot drop an item onto a button on the taskbar.\n<\/P>\n<P>\nHowever, if you drag the item over a button without releasing\nthe mouse button, the window will open after a moment,\nallowing you to drop the item inside the window.\n<\/P>\n<\/BLOCKQUOTE>\n<P>\nWhy doesn&#8217;t the taskbar let you drop directly onto a taskbar\nbutton?\n<\/P>\n<P>\nIdeally, if the taskbar receives a IDropTarget::Drop,\nit could do something like this:\n<\/P>\n<PRE>\n\/\/ imaginary code\nIDropTarget *pdt;\nif (SUCCEEDED(GetDropTargetFromWindow(hwndButton, &amp;pdt))) {\n  pdt-&gt;Drop(&#8230;);\n  pdt-&gt;Release();\n}\n<\/PRE>\n<P>\n(Warning: I said &#8220;something like&#8221; this.  Forwarding a drop is\nactually more complicated than this.)\n<\/P>\n<P>\nThe reason why the taskbar doesn&#8217;t do this is that there is no such\nfunction GetDropTargetFromWindow function.\nThe taskbar can&#8217;t forward the drop operation even if it wanted to.\n<\/P>\n<P>\nWhy is there no GetDropTargetFromWindow function?  I have no idea.\nYou&#8217;ll have to ask the OLE folks.\nIf I had to guess\n(and I know I have to because you folks will just keep badgering me\nuntil I come up with a guess),\nit&#8217;s because that would create the problem of how to\nprevent somebody from screwing with a program by\ngrabbing its drop target and never releasing it.\n<\/P>\n<P>\nNow of course people will criticize my explanation, so I&#8217;m going to\nsay it again: <STRONG>I don&#8217;t know the answer. I&#8217;m just guessing.\nMy guess is probably wrong.<\/STRONG>\n<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you drag a object and drop it onto a taskbar button, you get an error message that says, You cannot drop an item onto a button on the taskbar. However, if you drag the item over a button without releasing the mouse button, the window will open after a moment, allowing you to drop [&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":[26],"class_list":["post-37213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>If you drag a object and drop it onto a taskbar button, you get an error message that says, You cannot drop an item onto a button on the taskbar. However, if you drag the item over a button without releasing the mouse button, the window will open after a moment, allowing you to drop [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/37213","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=37213"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/37213\/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=37213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=37213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=37213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}