runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

代码未测试

 

[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  解析

 

posted on 2019-10-11 17:04  runliuv  阅读(488)  评论(0编辑  收藏  举报