473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

get text of SysListView32(LVS_OWNERDATA+LVS_OWN ERDRAWFIXED) items from other applications

Hello. I apologize in advance if I created the topic in the wrong place, because I think that my task is directly or indirectly related to WinApi. I will describe the task:
I am programming an imitation of manual work in applications for working on financial markets (Metatrader 4 and 5). I use AutoIt for this. I need to read the text of the SysListView32 elements. I wrote the following code for this purpose.
Expand|Select|Wrap|Line Numbers
  1. #include <WinAPI.au3>
  2. #include <Memory.au3>
  3. #include <ListViewConstants.au3>
  4. Local $pid=        ; here i write id of needed process
  5. Local $hwnd=      ; here i write handle of SysListView32 
  6. Local $maxtext=    ;here i write max number of chars 
  7. Local $hprocess=_WinAPI_OpenProcess($PROCESS_ALL_ACCESS,False,$pid)
  8. Local $plv=_MemVirtualAllocEx($hprocess,Null,$maxtext+60,$MEM_COMMIT,$PAGE_READWRITE)
  9. Local $rectext=DllStructCreate("char ["&$maxtext&"]")
  10. Local $lv=DllStructCreate($tagLVITEM)
  11. $lv.Mask=$LVIF_TEXT
  12. $lv.Item=0
  13. $lv.SubItem=0
  14. $lv.Text=$plv+60
  15. $lv.TextMax=$maxtext
  16. _WinAPI_WriteProcessMemory($hprocess,$plv,DllStructGetPtr($lv),60,Null)
  17. _SendMessageA($hwnd,$LVM_GETITEMA,0,$plv)
  18. _WinAPI_ReadProcessMemory($hprocess,$lv.Text,DllStructGetPtr($rectext),$maxtext,Null)
  19. _MemVirtualFreeEx($hprocess,$plv,0,$MEM_RELEASE)
  20. ConsoleWrite(DllStructGetData($rectext,1))
The problem is that the above code only gets the text if the SysListView32 has either LVS_OWNERDATA or LVS_OWNERDRAWFIXED style. But this code is not getting text of SysListView32 elements with combined LVS_OWNERDATA and LVS_OWNERDRAWFIXED styles.
Well here's the question:
How to get item text from SysListView32 from another application with both LVS_OWNERDATA and LVS_OWNERDRAWFIXED styles at the same time?
I would like to get some direction of action or example code (doesn't matter on AutoIt). Thank you.
Apr 3 '23 #1
0 1177

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael Williams | last post by:
Hi, I am trying to create a VB6 application which can act as a 'connection broker' for other applications being run on the same machine. Essentially, the broker app will setup a number of...
0
by: Eric | last post by:
Hi, I wonder if it is possible to listen to events from other applications that you have not written yourself and that you don't know anything about? Notepad or any other windows application for...
2
by: Justin | last post by:
How do you invoke other applications with or without command line arguments? -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
1
by: Admin East | last post by:
I want to create an application which monitor other applications status. It is same as Windows Task Manager's Application Tab. Status would be RUNNING or NOT RESPONDING. Thanks.
4
by: Usarian Skiff | last post by:
Is it possible to enter data into other applications' textboxes and datagrids? I want to automate our production control software (like a macro). It's written in VB6, and I have access to the...
0
by: C R | last post by:
I would like to write a program that sits in the background and captures double-click events (or function keys) in other applications, then does something with them or not depending on which...
4
by: Jerry Spence1 | last post by:
I have an application with an icon that sits in the system tray. When I double click it the form is maximised, but I want it to sit at the front of all the other applications that are open. How do...
0
MMcCarthy
by: MMcCarthy | last post by:
This is a module that exports information from a Query or a Table to comma separated values in a text format, or using other symbol! It is very helpful for sharing information between the...
5
by: Marco Trapanese | last post by:
Hi! I wrote a VB.NET application that serializes my classes on a file. Each file contains a different instance of the class (i.e. different values of the properties). If I deserialize files from...
0
by: Laszo Pasztor | last post by:
Hello! Is it possible to make actions when working with other applications. For example: I start my application. It runs in the background with no user interface. But when I for example drag...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.