[DllImport("user32.dll")]

public static extern long SendMessage(int hWnd, uint msg, uint wparam, string text);

 

  public const uint WM_SETTEXT = 0x0c;

 

  public const uint WM_GETTEXT = 0x0d;

 

  public const uint WM_LBUTTONUP = 0x0202;

 

  public const uint WM_LBUTTONDOWN = 0x0201;

 

 

傳送字串:

 SendMessage(輸入欄位的Handle, WM_SETTEXT, 0, "你要送的字串" );

 

 

傳送對按鈕按下去的訊號:

 SendMessage(按鈕的Handle, WM_LBUTTONDOWN, 0, null);

 SendMessage(按鈕的Handle, WM_LBUTTONUP, 0, null);

welkingunther 發表在 痞客邦 PIXNET 留言(1) 人氣()


留言列表 (1)

發表留言
  • Spencer Lee
  • Thanks to share
  • You are welcome~~

    welkingunther 於 2012/08/09 16:28 回覆