{"id":14733,"date":"2010-03-04T07:00:00","date_gmt":"2010-03-04T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/03\/04\/what-happens-if-i-drag-the-mouse-by-exactly-the-amount-specified-by-sm_cxdrag\/"},"modified":"2010-03-04T07:00:00","modified_gmt":"2010-03-04T07:00:00","slug":"what-happens-if-i-drag-the-mouse-by-exactly-the-amount-specified-by-sm_cxdrag","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20100304-00\/?p=14733","title":{"rendered":"What happens if I drag the mouse by exactly the amount specified by SM_CXDRAG?"},"content":{"rendered":"<p>\nThe drag sensitivity is specified by the system metrics\n<code>SM_CXDRAG<\/code> and <code>SM_CYDRAG<\/code>.\nWhat happens if I drag the mouse by exactly the amount specified by\nthese two parameters?\n<\/p>\n<p>\nNothing.\n<\/p>\n<p>\nThese parameters control the drag <i>insensitivity<\/i> of the mouse.\nIf your mouse motion is less than or equal to this amount, then nothing\nhappens.\nThis is spelled out in the documentation for\n<code>GetSystemMetrics<\/code>:\n<\/p>\n<blockquote CLASS=\"m\"><p>\nThe number of pixels on either side of a mouse-down point\nthat the mouse pointer can move before a drag operation begins.\n<\/p><\/blockquote>\n<p>\nIt&#8217;s how far the mouse can move before the system detects a drag.\nIn code, the algorithm is as follows:\n<\/p>\n<pre>\nBOOL ShouldStartDragging(POINT ptStart, POINT ptCur)\n{\n    RECT rc = { ptStart.x, ptStart.y, ptStart.x, ptStart.y };\n    InflateRect(&amp;rc, GetSystemMetrics(SM_CXDRAG),\n                         GetSystemMetrics(SM_CYDRAG));\n    return !PtInRect(&amp;rc, ptCur);\n}\n<\/pre>\n<p>\nSome people appear to\nhave\n<a HREF=\"http:\/\/xona.com\/2006\/12\/12.html\">\nread a bit too much into the fluffy description<\/a>\nof this setting.\nI wrote the text to be vague so I wouldn&#8217;t have\nto go into annoyingly precise details.\nIt specifies how far the mouse must move, but I didn&#8217;t say\nexactly how.\nOtherwise, the text (which is pretty full already)\nwould have had to say something unwieldy like\n&#8220;Drag sensitivity specifies the distance (in pixels)\n<i>beyond which<\/i> the mouse must move with the button held down&#8230;&#8221;\nI did say that &#8220;the icon will begin dragging when you have\nmoved the mouse the necessary distance.&#8221;\nThis was my way of saying,\n&#8220;The test icon shows you what happens.\nJust fiddle with the setting until the test icon behaves\nthe way you like.&#8221;\n<\/p>\n<p>\nIn retrospect, I could&#8217;ve simply changed the word\n<i>must<\/i> to <i>can<\/i>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The drag sensitivity is specified by the system metrics SM_CXDRAG and SM_CYDRAG. What happens if I drag the mouse by exactly the amount specified by these two parameters? Nothing. These parameters control the drag insensitivity of the mouse. If your mouse motion is less than or equal to this amount, then nothing happens. This is [&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-14733","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>The drag sensitivity is specified by the system metrics SM_CXDRAG and SM_CYDRAG. What happens if I drag the mouse by exactly the amount specified by these two parameters? Nothing. These parameters control the drag insensitivity of the mouse. If your mouse motion is less than or equal to this amount, then nothing happens. This is [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14733","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=14733"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/14733\/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=14733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=14733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=14733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}