SendMessage() to other App w/ a "String"

D

Daniel Halan

Hello,

I want to send a SendMessage(hwnd,...) to an another application containing
eighter a "String" or a PIDL... I know that the pointer lives in its own
process so the other app will have problems reading it. How was it done to
create the String / PIDL in a common memoryspace?

What I want to do is:

string szFolder = @"C:\temp\";
hWinApi.SendMessage(hwnd,hWinApi.BFFM_SETSELECTIONA,new IntPtr(1),szFolder);

Where hwnd is an Handle to an other application caught by FindWindow().


// Daniel
 
W

William DePalo [MVP VC++]

Daniel Halan said:
I want to send a SendMessage(hwnd,...) to an another application
containing eighter a "String" or a PIDL... I know that the pointer lives
in its own process so the other app will have problems reading it. How was
it done to create the String / PIDL in a common memoryspace?

What I want to do is:

string szFolder = @"C:\temp\";
hWinApi.SendMessage(hwnd,hWinApi.BFFM_SETSELECTIONA,new
IntPtr(1),szFolder);

Where hwnd is an Handle to an other application caught by FindWindow().

The simplest thing to do is to send a WM_COPYDATA message. If you do that
then Windows will map the buffer sent to the target process' address space
while the handler for the message is running.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top