January 27th, 2004, 06:24 PM
memory from hWnd????
I am writing an application that gets the information out of a msflexgrid that is running in another application.
The first problem i encountered was getting into the address space of the target application. This was acheivied by using a DLL to create a getmessage hook into the target application, which then loads the entire dll into the target address space. My problem is, now that i have access to the correct process context, how do i go about getting information out of the msflexgrid?
I know the hwnd of the application, can i use this to get a memory pointer? How else could i identify the msflexgrid (or its memory) so that i can access its data?
THanks so much for this, i have been working on it since the end of october and this is the closest i think i have been, but im stuck again.... any help at all would be fantastic
January 28th, 2004, 10:00 AM
Hope so this helps
I think you are almost near to solution.
1. Use Hook method and load DLL in in 3rd party applications address space.
2. Have a Window Proc in DLL so you will be able to receive messages of that app.
3. If you know the control Id of flexGrid then use GetDlgItm funtion to get the handle of control...
I agree..This is not that much easy....But I feel that this is the way you need to go...
January 28th, 2004, 03:31 PM
You should be able to use one of the Interprocess Communications (IPC) facilities, however it is probably best to not use the WM_COPYDATA message, since it is sent by SendMessage. However since your hook is not system-wide (right?) it will probably not be a significant performance problem to use SendMessage. Probably you can use a memory-mapped file, which is Windows' way of providing shared memory. The WM_COPYDATA message uses shared memory to do what it does. I don't know how much of an actual performance improvement you will get if you do the shared memory yourself compared to using the WM_COPYDATA message to do it, so it is up to you to decide what to do. Perhaps you can use the WM_COPYDATA message initially and then (hopefully) improve performance by using shared memory directly. Note that if you use shared memory, you must have a way to synchronize it.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.