随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253


问题来源: http://www.cnblogs.com/del/archive/2009/10/27/1590975.html#1696167
procedure TForm1.Button1Click(Sender: TObject);
var
  hEdit: HWND;
  str: string;
begin
  str := '准备要添加到记事本的字符串';
  WinExec('Notepad.exe', SW_SHOWNORMAL);
  hEdit := GetWindow(GetForegroundWindow, GW_CHILD);
  SendTextMessage(hEdit, WM_SETTEXT, 0, str);
end;

posted on 2009-11-12 13:05  万一  阅读(...)  评论(...编辑  收藏