本文介绍了有关WM_COPYDATA的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正准备使用wm_copydata在2个应用程序之间进行通信.

我不确定如何使用COPYDTASTRUCT通过HWND.

Hello all, I am tring to communicate between 2 applications using wm_copydata.

I am not sure how to pass HWND using COPYDTASTRUCT.

HWND hWnd = FindWindow(NULL, "Advisor");
	if (hWnd)
	{
/////Sending Application.
		COPYDATASTRUCT cds;
		ZeroMemory(&cds, sizeof(COPYDATASTRUCT));
		cds.dwData = WM_CREATE;
		cds.lpData = (HWND)ResulthWnd;
		cds.cbData = sizeof(ResulthWnd);
		SendMessage(hWnd,WM_COPYDATA,(WPARAM)ResulthWnd,(LPARAM)&cds);
         }

////////Receiving Application
switch (pCopyDataStruct->dwData)
	{
	case WM_CREATE:
         HWND SenderWnd = (HWND)pCopyDataStruct->lpData;
break;
         }




有人可以帮忙吗?

在此先感谢.




Can someone please help.

Thanks in advance.

推荐答案


这篇关于有关WM_COPYDATA的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 16:45