试试这个:
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern int PostMessage(IntPtr hWnd, int msg, int wParam, ref CopyDataStruct lParam);
然后使用:
PostMessage(_hWnd, 500, 10001, 0);//表示发送到 句柄为 _hWnd 的控件,发送消息的标识符为:500,发送的消息内容为“10001,0”
好吧,我给您解答一哈!首先吧,这个做人得厚道!不能太小气,尤其你是个男子更不能小气。只有大气才能成器。请你量力而行,只自知明。冷穿衣而吃饭。井水不犯河水。爱咋咋地。
以上纯属事实。请要模仿,以免后患~~~~~~
小小亲笔~
http://hi.baidu.com/zerolight/blog/item/a2529ac23310f90c0ef4778f.html
参考这个,用API轻松实现.记住看完给分,是你要的东西
[DllImport("user32.dll", EntryPoint="FindWindow")]
public static extern int FindWindow (string lpClassName,string lpWindowName);
[DllImport("user32.dll", EntryPoint="FindWindowEx")]
public static extern int FindWindowEx (int hWnd1,int hWnd2,string lpsz1,string lpsz2);
[DllImport("user32.dll", EntryPoint="SendMessage")]
public static extern int SendMessage (int hwnd,int wMsg,int wParam,ref int lParam);
[DllImport("user32.dll", EntryPoint="SendMessage")]
public static extern int SendMessage (int hwnd,int wMsg,string wParam,string lParam);
以前搞过。么搞出来、、
同求、、