memory from hWnd????
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: memory from hWnd????

  1. #1
    Join Date
    Nov 2003
    Location
    Gold Coast, Australia
    Posts
    2

    memory from hWnd????

    Hi all,

    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

    Todd.

  2. #2
    Join Date
    Jul 2001
    Location
    Pune-India
    Posts
    251

    Hope so this helps

    Hi,
    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...
    Regards
    Nagesh

  3. #3
    Join Date
    May 1999
    Location
    Southern California
    Posts
    12,266
    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.
    "Signature":
    My web site is Simple Samples.
    C# Corner Editor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center