thinkof Posted July 20, 2015 Posted July 20, 2015 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) _MemFree($tMemMap)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,https://msdn.microsoft.com/en-us/library/windows/desktop/bb775583(v=vs.85).aspxNMLVDISPINFO structure:https://msdn.microsoft.com/en-us/library/windows/desktop/bb774780(v=vs.85).aspxAnyone who has any idear about how to get cell data from a virtual listview ?
junkew Posted July 20, 2015 Posted July 20, 2015 https://msdn.microsoft.com/en-us/library/windows/desktop/ff486373(v=vs.85).aspxSee iuiautomation examples 18 maybe they can be of help FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
goss34 Posted July 20, 2015 Posted July 20, 2015 Linking you to old thread i had issues getting the data from the virutal listview, hope it helps.
thinkof Posted July 21, 2015 Author Posted July 21, 2015 Thanks for replies guys, i found a post of junkew and work it out. https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/?page=1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now