What's the difference between LVM_HITTEST and LVM_INSERTMARKHITTEST?
One customer was confused by the two list view hit-test messages
LVM_INSERTMARKHITTEST. What is the difference between the two?
LVM_HITTEST message tries to find the item the point is over.
LVM_INSERTMARKHITTEST message tries to find the item the point is next to.
For example, suppose you have two 32×32 items, item zero at (0, 0) and item one at (0, 32).
|On item 1
|Next to item 1 on the top side
|Next to item 1 on the bottom side
LVM_HITTEST when you the user is dragging something and you want to see what the item is going to be dropped on. 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.
LVM_INSERTMARKHITTEST when the user is dragging something and you want to see what the item is going to be dropped between. 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
LVM_INSERTMARKHITTEST message tells you where the dropped item should go.
The shell uses both of these hit-test messages when you drop a file into an Explorer window. It uses the Explorer uses
LVM_HITTEST to determine whether you’re dropping the file onto an item in the folder (hit-test reports an item) or whether you’re dropping the file into the folder itself (hit-test reports nowhere). Furthermore, if you’re dropping into the folder and Auto-Arrange is enabled, then Explorer uses the
LVM_INSERTMARKHITTEST to determine where to place the item after it is dropped.