c# api如何转为vfp
SendMessage(lnCallMeHWnd,WM_COPYDATA, 0,@m.lcText)string sendString = 测试发送数据;
byte[] sarr = System.Text.Encoding.Default.GetBytes(sendString);
int len = sarr.Length;
COPYDATASTRUCT cds;
cds.dwData = (IntPtr)0 ;
cds.cbData = len + 1;
cds.lpData = sendString;
SendMessage(hWnd, WM_COPYDATA, 0, ref cds);
接收方:
if (m.Msg == WMA_InterPro)
{
COPYDATASTRUCT cds = new COPYDATASTRUCT();
Type t = cds.GetType();
cds = (COPYDATASTRUCT)m.GetLParam(t);
string receiveInfo=cds.lpData;
}