Jump to content
Sign in to follow this  

Get cell text from a virtual listview

Recommended Posts

A virtual list view is a list-view control that has the LVS_OWNERDATA style. This style enables the control to handle millions of items because the owner receives the burden of managing item data. This allows you to use the virtual list-view control with large databases of information, where specific methods of data access are already in place.

A virtual list-view control maintains very little item information itself. Except for the item selection and focus information, the owner of the control must manage all item information. Other processes request item information from the owner by using LVN_GETDISPINFO notification codes.


#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <SendMessage.au3>
#include <Memory.au3>

Local $hLV = ControlGetHandle($hWnd, 0, 33727)
Local $hParent=_WinAPI_GetParent($hLV)

Local $tDISPINFO = DllStructCreate($tagNMLVDISPINFO)
Local $pDISPINFO = DllStructGetPtr($tDISPINFO)
Local $iSize=DllStructGetSize($tDISPINFO)

DllStructSetData($tDISPINFO, "Item", 1)
DllStructSetData($tDISPINFO, "SubItem", 4)
DllStructSetData($tDISPINFO, "IDFrom", 33217)
DllStructSetData($tDISPINFO, "Code", $LVN_GETDISPINFO)

Local $tMemMap = DllStructCreate($tagMEMMAP)
Local $pMemory=_MemInit($hParent, $iSize, $tMemMap)
; ... copy struct data to target process memory
_MemWrite($tMemMap, $pDISPINFO, $pMemory, $iSize)

;... Now, the question comes..
_SendMessage($hParent, $WM_NOTIFY, $LVN_GETDISPINFO, $pMemory)

;... Read to local struct
_MemRead($tMemMap, $pMemory, $pDISPINFO, $iSize)

Local $sText = DllStructGetData($tDISPINFO, "Text")
ConsoleWrite(@LF & "Text:" & $sText & @LF)


The problem is 'WM_NOTIFY' can't be sent to target control. I think the reason is "For Windows Vista and later systems, the WM_NOTIFY message cannot be sent between processes.", as below,



Anyone who has any idear about how to get cell data from a virtual listview ?

Share this post

Link to post
Share on other sites

Linking you to old thread i had issues getting the data from the virutal listview, hope it helps.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...