Christian Berczely
2011-03-31 19:21:46 UTC
I am using C# to build an application that gets values of a ListBox
that is in another application.
Here, hListBox is the handle to the ListBox running in the other
application.
I am using SendMessage(hListBox, LB_GETCURSEL, IntPtr.Zero,
IntPtr.Zero) to get the current selected item from this ListBox. This
works well.
Then when I try to get the length and text it does not work.
This is what I have used to get the text: SendMessage(hListBox,
LB_GETTEXT, new IntPtr(pos), ipRemoteBuffer);
Do I need also to call VirtualAllocEx to create a text buffer on the
other application's space?
Then use ReadProcessMemory to read this out?
I have created a .net VC application that has the ListBox within the
same app where by code is, and this works. So I think the issue is on
getting the text from an external application...
I would really appreciate some sample code.
Christian
that is in another application.
Here, hListBox is the handle to the ListBox running in the other
application.
I am using SendMessage(hListBox, LB_GETCURSEL, IntPtr.Zero,
IntPtr.Zero) to get the current selected item from this ListBox. This
works well.
Then when I try to get the length and text it does not work.
This is what I have used to get the text: SendMessage(hListBox,
LB_GETTEXT, new IntPtr(pos), ipRemoteBuffer);
Do I need also to call VirtualAllocEx to create a text buffer on the
other application's space?
Then use ReadProcessMemory to read this out?
I have created a .net VC application that has the ListBox within the
same app where by code is, and this works. So I think the issue is on
getting the text from an external application...
I would really appreciate some sample code.
Christian