delphi :打开记事本并写入内容[转]
procedure TForm.ButtonClick(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 2011-01-11 23:53 Delphi7456 阅读(1414) 评论(0) 编辑 收藏 举报