{"id":24703,"date":"2007-10-24T10:00:00","date_gmt":"2007-10-24T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2007\/10\/24\/whats-the-difference-between-lvm_hittest-and-lvm_insertmarkhittest\/"},"modified":"2007-10-24T10:00:00","modified_gmt":"2007-10-24T10:00:00","slug":"whats-the-difference-between-lvm_hittest-and-lvm_insertmarkhittest","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20071024-00\/?p=24703","title":{"rendered":"What&#039;s the difference between LVM_HITTEST and LVM_INSERTMARKHITTEST?"},"content":{"rendered":"<p>One customer was confused by the two list view hit-test messages <code>LVM_HITTEST<\/code> and <code>LVM_INSERTMARKHITTEST<\/code>. What is the difference between the two?\n The <code>LVM_HITTEST<\/code> message tries to find the item the point is <i>over<\/i>.\n The <code>LVM_INSERTMARKHITTEST<\/code> message tries to find the item the point is <i>next to<\/i>.\n For example, suppose you have two 32&times;32 items, item zero at (0,&nbsp;0) and item one at (0,&nbsp;32).<\/p>\n<table>\n<tr>\n<th>Coordinates<\/th>\n<th><code>LVM_HITTEST<\/code><\/th>\n<th><code>LVM_INSERTMARKHITTEST<\/code><\/th>\n<\/tr>\n<tr>\n<td>(0,&nbsp;34)<\/td>\n<td>On item&nbsp;1<\/td>\n<td>Next to item&nbsp;1 on the top side<\/td>\n<\/tr>\n<tr>\n<td>(0,&nbsp;99)<\/td>\n<td>Nowhere<\/td>\n<td>Next to item&nbsp;1 on the bottom side<\/td>\n<\/tr>\n<\/table>\n<p> You use <code>LVM_HITTEST<\/code> when you the user is dragging something and you want to see what the item is going to be dropped <i>on<\/i>. For example, your program might ask the user to drag an icon representing a trouble report and drop it onto the icon representing the department the report should be assigned to.\n You use <code>LVM_INSERTMARKHITTEST<\/code> when the user is dragging something and you want to see what the item is going to be dropped <i>between<\/i>. For example, your program might show a list of customers, and the user can drag a new customer into the list or rearrange the customers by dragging an existing one. The <code>LVM_INSERTMARKHITTEST<\/code> message tells you where the dropped item should go.<\/p>\n<p> The shell uses both of these hit-test messages when you drop a file into an Explorer window. It uses the Explorer uses <code>LVM_HITTEST<\/code> to determine whether you&#8217;re dropping the file onto an item in the folder (hit-test reports an item) or whether you&#8217;re dropping the file into the folder itself (hit-test reports nowhere). Furthermore, if you&#8217;re dropping into the folder and Auto-Arrange is enabled, then Explorer uses the <code>LVM_INSERTMARKHITTEST<\/code> to determine where to place the item after it is dropped. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>One customer was confused by the two list view hit-test messages LVM_HITTEST and LVM_INSERTMARKHITTEST. What is the difference between the two? The LVM_HITTEST message tries to find the item the point is over. The LVM_INSERTMARKHITTEST message tries to find the item the point is next to. For example, suppose you have two 32&times;32 items, item [&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-24703","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>One customer was confused by the two list view hit-test messages LVM_HITTEST and LVM_INSERTMARKHITTEST. What is the difference between the two? The LVM_HITTEST message tries to find the item the point is over. The LVM_INSERTMARKHITTEST message tries to find the item the point is next to. For example, suppose you have two 32&times;32 items, item [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/24703","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=24703"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/24703\/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=24703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=24703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=24703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}