#PROCESS_VM_READ = $10
#Message_Init      = #WM_USER + 1 
#Message_String    = #WM_USER + 2

Procedure WindowCallback(Window, Message, wParam, lParam)
  Shared Sender_ProcessHandle.l
  result = #PB_ProcessPureBasicEvents
  
  Select Message
  
    Case #Message_Init
      Sender_ProcessHandle = OpenProcess_(#PROCESS_VM_READ, 0, lParam)
      If Sender_ProcessHandle <> 0
        result = #True
      Else
        result = #False
      EndIf
      
    Case #Message_String
      String.s = Space(lParam)
      If ReadProcessMemory_(Sender_ProcessHandle, wParam, @String, lParam, @BytesRead.l) <> 0
        If BytesRead <> lParam
          result = #False
        Else
        
          ;===================================================================================
          ; Here you can work with the String you recived.
          ; In my example, the String is added to a ListView.
          ; Keep in Mind that you shouldn't do stuff here that takes much time (as the Sending App waits 
          ; for the Callback to send the Return Value.)
          
          AddGadgetItem(0, -1, String)
          SetGadgetState(0, CountGadgetItems(0)-1)
          
          ;===================================================================================
        
        
          result = #True
        EndIf
      Else
        MessageRequester("", Str(getlasterror_()), 0)
        result = #False
      EndIf
  
  EndSelect
  ProcedureReturn result
EndProcedure


OpenWindow(0, 400, 0, 300, 200, #PB_Window_SystemMenu, "Send Target")
CreateGadgetList(WindowID())
ListViewGadget(0, 0, 0, 300,200)

SetWindowCallback(@WindowCallback())

While WaitWindowEvent() <> #PB_EventCloseWindow: Wend
End