SendMessage not work well #258
Unanswered
Sunzhuokai
asked this question in
Q&A
Replies: 1 comment 1 reply
-
the core code: onTap: () {
var tet = "test";
var u = tet.toNativeUtf8();
SendMessage(handle, 0x004A, 0, u.address);
free(u);
}, protected override void DefWndProc(ref Message m)
{
switch (m.Msg)
{
case WM_COPYDATA:
this.label3.Text = DateTime.Now.ToFileTimeUtc().ToString();
var s = Marshal.PtrToStringAuto(m.LParam);
var bytes = Encoding.Unicode.GetBytes(s);
var str = Encoding.Default.GetString(bytes);
this.textBox1.Text = str;
m.Result = new IntPtr(1);
break;
default:
base.DefWndProc(ref m);
break;
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use
SendMessage
to sendWM_COPYDATA
message to B process(WinForm) in A process(Flutter). the B process(Winform) can receive message sometime but not everytime!Beta Was this translation helpful? Give feedback.
All reactions