Link to home
Start Free TrialLog in
Avatar of ianwhite
ianwhite

asked on

CListCtrl->GetItem() across processes

I need to get the text from a multi column listview in an Application I dont have src code for.
I can get a handle to the listview, attach a listctrl and do things like get an itemcount, and call deleteItem.

The problem comes when I try to call GetItem or GetItemText.
I've been told its because passing memory pointers across processes is not straight forward.

Fine, But can it be done. I have src for the program getting the information, not for the program the listctrl is in.

Has any one done this, or seen a solution for it ?

thanks ,

Ian
ianw@microfocus.co.uk
Avatar of Tommy Hui
Tommy Hui

Using the common controls across processes do not work. In order to retrieve information about a common control across process boundaries, it is necessary to write a DLL that can be injected into the target process space. Usually, writing a system hook will do the job the quickest. Then you need to write a process that communicates with the DLL to get the DLL to do that thing you need, but in the context of the target process. The DLL has to then write the information into a memory map so that another process can access it.

What you're trying to do is not trivial and that is why the solution is that much harder.
Avatar of ianwhite

ASKER

Ok thanks so far, but I'm still a little confused.
Does that mean I need to enable the process the owns the list box to load the dll, or is it possible to force the dll to become part of that applications process space ?
My problem is I dont have source code for the target App, so is this going to stop me dead ?

Also, is that problem solved by writing a system hook, or was that how you were recomending to read from the listctrl, once the dll was in the process space ?

cheers !
Please see my comments, can you provide some more information ?

thanks,
ASKER CERTIFIED SOLUTION
Avatar of bitq
bitq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cheers bitq.

I've not used Hooks before, but have been playing around with a couple of samples from CodeGuru.

I think I'll be able to sort it out from here on in!

thanks again.