可以使用WM_COPYDATA,以下是MSDN的帮助<br>An application sends the WM_COPYDATA message to pass data to another application. <br><br>To send this message, call the SendMessage function with the following parameters (do not call the PostMessage function). <br><br>SendMessage( <br> (HWND) hWnd, // handle to destination window <br> WM_COPYDATA, // message to send<br> (WPARAM) wParam, // handle to window (HWND)<br> (LPARAM) lParam // data (PCOPYDATASTRUCT)<br>);<br>Parameters<br>wParam <br>Handle to the window passing the data. <br>lParam <br>Pointer to a COPYDATASTRUCT structure that contains the data to be passed. <br>Return Values<br>If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE. <br><br>Remarks<br>The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data. <br><br>While this message is being sent, the referenced data must not be changed by another thread of the sending process. <br><br>The receiving application should consider the data read-only. The lParam parameter is valid only during the processing of the message. The receiving application should not free the memory referenced by lParam. If the receiving application must access the data after SendMessage returns, it must copy the data into a local buffer. <br><br>When you send a WM_COPYDATA message, SendMessage allocates a block of memory cbData bytes in size and copies the data from the caller's address space to this block. It then sends the message to the destination window. When the receiving window procedure processes this message, the lParam parameter is a pointer to a COPYDATASTRUCT structure that exists in the address space of the receiving process. The lpData member is a pointer to the copied block of memory, and the address reflects the memory location in the receiving process's address space. <br><br>