This is the example to show how to send a cstring from one application to another.
Paste this follwing code at sender.
csData=" This is the message";
COPYDATASTRUCT copyDT;//Is used for Interprocess communication
copyDT.dwData = NULL;
copyDT.cbData = _tcslen(csData) + 1;
copyDT.lpData = ( void* ) ( ( LPCTSTR ) csData );
HWND hWnd = ::FindWindow(NULL,"Receiver application");
// Finding the handle of receiver application and send
// WM_COPYDATA message is used for Interprocess communication
::SendMessage( hWnd, WM_COPYDATA, 0, (LPARAM)©DT );
At receiver add WM_COPYDATA message.
Paste the following code