在 vb6 中使用此代码发送数据
cds.dwData = CLng(RegisterWindowMessage("MyWMCopyData"))
cds.cbData = Len(Message) * 2 ' characters are 2-bytes each
cds.lpData = StrPtr(Message) ' access the string's character buffer directly
' Send the string.
Dim i As Long:i = SendMessage(lHwnd, WM_COPYDATA, MainForm.hwnd, cds)
你能帮我用代码来接收它吗?我有这个
Dim B() As Byte
ReDim B(0 To tCDS.cbData - 1) As Byte
CopyMemory B(0), ByVal tCDS.lpData, tCDS.cbData
Dim sData As String
sData = Trim$(StrConv(B, vbUnicode))
如果我发送Hello
,我得到它H e l l o