Method WndCopyData.SendReceive(+ 2 overloads)
Overload
Sends string or other data to a window of any process. Uses API SendMessage WM_COPYDATA. Receives string or other data returned by that window with WndCopyData.Return.
public static bool SendReceive<TSend, TReceive>(wnd w, int dataId, ReadOnlySpan<TSend> send, WndCopyData.ResultReader<TReceive> receive) where TSend : unmanaged where TReceive : unmanaged
Parameters
|
w (wnd)
The window. |
|
dataId (int)
Data id. It is COPYDATASTRUCT.dwData. |
|
send (ReadOnlySpan<TSend>)
Data to send. For example string or |
|
receive (WndCopyData.ResultReader<TReceive>)
Callback function that can convert the received data to desired format. |
Returns
|
bool
|
Type Parameters
|
TSend
Type of data elements. For example, |
|
TReceive
Type of received data elements. For example, |
Overload(next)
Calls SendReceive<TSend, TReceive>(wnd, int, ReadOnlySpan<TSend>, ResultReader<TReceive>) and gets the received data as byte[].
public static bool SendReceive<TSend>(wnd w, int dataId, ReadOnlySpan<TSend> send, out byte[] received) where TSend : unmanaged
Parameters
|
w (wnd)
The window. |
|
dataId (int)
Data id. It is COPYDATASTRUCT.dwData. |
|
send (ReadOnlySpan<TSend>)
Data to send. For example string or |
|
received (byte[])
The received data. |
Returns
|
bool
|
Type Parameters
|
TSend
Type of data elements. For example, |
Overload(top)
Calls SendReceive<TSend, TReceive>(wnd, int, ReadOnlySpan<TSend>, ResultReader<TReceive>) and gets the received string.
public static bool SendReceive<TSend>(wnd w, int dataId, ReadOnlySpan<TSend> send, out string received) where TSend : unmanaged
Parameters
|
w (wnd)
The window. |
|
dataId (int)
Data id. It is COPYDATASTRUCT.dwData. |
|
send (ReadOnlySpan<TSend>)
Data to send. For example string or |
|
received (string)
The received data. |
Returns
|
bool
|
Type Parameters
|
TSend
Type of data elements. For example, |