An application sends the WM_COPYDATA message to pass data to another application

对于只是在有VB,VC开发两个应用程序中传递数组如此简单的数据,没必要用什么DLL,内存映射之类的大刀吧

WM_copYDATA Message

--------------------------------------------------------------------------------

An application sends the WM_copYDATA message to pass data to another application.

Syntax


To send this message,call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl,// handle to destination control (UINT) WM_copYDATA,// message ID (WParaM) wParam,// = (WParaM) () wParam; (LParaM) lParam // = (LParaM) () lParam; );
Parameters

wParam
Handle to the window passing the data.
lParam
Pointer to a copYDATASTRUCT structure that contains the data to be passed.
Return Value

If the receiving application processes this message,it should return TRUE; otherwise,it should return FALSE.


The copYDATASTRUCT structure contains data to be passed to another application by the WM_copYDATA message.

Syntax

typedef struct tagcopYDATASTRUCT {
ULONG_PTR dwData;
DWORD cbData;
PVOID lpData;
} copYDATASTRUCT,*PcopYDATASTRUCT;
Members

dwData
Specifies data to be passed to the receiving application.
cbData
Specifies the size,in bytes,of the data pointed to by the lpData member.
lpData
Pointer to data to be passed to the receiving application. This member can be NULL.

转来的,还没经过测试呢,如果有问题概不负责!!!

相关文章

Format[$] ( expr [ , fmt ] ) format 返回变体型 format$ 强...
VB6或者ASP 格式化时间为 MM/dd/yyyy 格式,竟然没有好的办...
在项目中添加如下代码:新建窗口来显示异常信息。 Namespace...
转了这一篇文章,原来一直想用C#做k3的插件开发,vb没有C#用...
Sub 分列() ‘以空格为分隔符,连续空格只算1个。对所选...
  窗体代码 1 Private Sub Text1_OLEDragDrop(Data As Dat...