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

  • Thread starter Thread starter Daniel Halan
  • Start date Start date
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
 
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
 
Back
Top