|
|
浮子屋商店もよろしく。 |
|
WM_COPYDATAを受ける
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| | [StructLayout(LayoutKind.Sequential)]
private struct COPYDATASTRUCT {
public IntPtr dwData;
public int cbData;
public IntPtr lpData;
}
private const int WM_COPYDATA = 0x4A;
protected override void WndProc(ref Message m) {
if(m.Msg==WM_COPYDATA){
COPYDATASTRUCT cds = new COPYDATASTRUCT();
cds = (COPYDATASTRUCT) Marshal.PtrToStructure(m.LParam, typeof(COPYDATASTRUCT));
if (cds.cbData > 0) {
byte[] data = new byte[cds.cbData];
Marshal.Copy(cds.lpData, data, 0, cds.cbData);
}
m.Result=(IntPtr)1;
}
base.WndProc (ref m);
}
|
|