<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Listview HitTest method is broken.</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : Listview HitTest method is broken.]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 13:13:23 +0000</pubDate>
  <lastBuildDate>Mon, 14 Sep 2009 02:59:11 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=15163</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Listview HitTest method is broken. : Hi,  Using version 12.1.1 the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15163&amp;PID=52965&amp;title=listview-hittest-method-is-broken#52965</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2113">ijwelch</a><br /><strong>Subject:</strong> 15163<br /><strong>Posted:</strong> 14 September 2009 at 2:59am<br /><br />Hi,<br /><br />Using version 12.1.1 the listview HitTest method seems to return the first visible item, not the one at X,Y. Something's wrong so suggest CJ make sure fixed before next release.<br /><br />If anyone needs correct code then this works:<br /><br /><br /><br /><font color=blue>Private Const LVM_FIRST As Long = &H1000<br />Private Const LVM_HITTEST As Long = (LVM_FIRST + 18)<br />Private Const LVM_SUBITEMHITTEST As Long = (LVM_FIRST + 57)<br />Private Const LVHT_NOWHERE As Long = &H1<br />Private Const LVHT_ONITEMICON As Long = &H2<br />Private Const LVHT_ONITEMLABEL As Long = &H4<br />Private Const LVHT_ONITEMSTATEICON As Long = &H8<br />Private Const LVHT_ONITEM As Long = (LVHT_ONITEMICON Or _<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  LVHT_ONITEMLABEL Or _<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  LVHT_ONITEMSTATEICON)<br />Private Type POINTAPI<br />&nbsp;&nbsp;&nbsp;x As Long<br />&nbsp;&nbsp;&nbsp;y As Long<br />End Type<br /><br />Private Type LVHITTESTINFO<br />&nbsp;&nbsp;&nbsp;&nbsp;pt As POINTAPI<br />&nbsp;&nbsp;&nbsp;&nbsp;flags As Long<br />&nbsp;&nbsp;&nbsp;&nbsp;iItem As Long<br />&nbsp;&nbsp;&nbsp;&nbsp;iSubItem  As Long  'ie3+ only .. was NOT in win95.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  'Valid only for LVM_SUBITEMHITTEST<br />End Type<br /><br />Private Declare Function SendMessage Lib "user32" _<br />&nbsp;&nbsp;&nbsp;Alias "SendMessageA" _<br />  (ByVal hwnd As Long, _<br />&nbsp;&nbsp;&nbsp;ByVal wMsg As Long, _<br />&nbsp;&nbsp;&nbsp;ByVal wParam As Long, _<br />&nbsp;&nbsp;&nbsp;lParam As Any) As Long<br />&nbsp;&nbsp;&nbsp;<br />Public Function ExtremeListView_HitTest(lv As XtremeSuiteControls.ListView, x As Long, y As Long) As XtremeSuiteControls.ListViewItem<br />Dim HTI As LVHITTESTINFO<br /><br />'&nbsp;&nbsp;&nbsp;&nbsp;Set ExtremeListView_HitTest = lv.HitTest(x, y) - this is broken<br /><br />With HTI<br />&nbsp;&nbsp;&nbsp;&nbsp;.pt.x = (x)<br />&nbsp;&nbsp;&nbsp;&nbsp;.pt.y = (y)<br />&nbsp;&nbsp;&nbsp;&nbsp;.flags = LVHT_ONITEM<br />End With<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />Call SendMessage(lv.hwnd, LVM_SUBITEMHITTEST, 0, HTI)<br />If HTI.iItem &gt; -1 Then<br />&nbsp;&nbsp;&nbsp;&nbsp;Set ExtremeListView_HitTest = lv.ListItems(HTI.iItem + 1)<br />End If<br />End Function</font>]]>
   </description>
   <pubDate>Mon, 14 Sep 2009 02:59:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15163&amp;PID=52965&amp;title=listview-hittest-method-is-broken#52965</guid>
  </item> 
 </channel>
</rss>