代码未测试
[DllImport("USER32", EntryPoint = "SendMessage", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); IntPtr textPointer = Marshal.StringToCoTaskMemUni("Magic String"); SendMessage(handle, WM_SETTEXT, IntPtr.Zero, textPointer); Marshal.FreeCoTaskMem(textPointer);
-
Marshal.PtrToStringUni 解析