473,216 Members | 1,569 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,216 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 1007

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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.