wchar_t winCaption[_MAX_PATH] = { 0 };
caption.toWCharArray(winCaption);
caption.toWCharArray(winCaption);
HWND receiveWindow = ::FindWindow(NULL, winCaption);
if (receiveWindow == NULL)
break;
wchar_t data[_MAX_PATH] = { 0 };
int length = filePath.toWCharArray(data);
COPYDATASTRUCT copyData = { 0 };
copyData.lpData = data;
copyData.cbData = (length + 1) * sizeof(wchar_t);
::SendMessage(receiveWindow, WM_COPYDATA, (WPARAM)winId(), (LPARAM)©Data);
注意在vista,win7不同进程中,需要过滤消息。