问题
In my application, i add/append exception log in notepad and now logs are too big so to make it user friendly i decide to set cursor position at end of text of log file so when user click on "View Log" button from application s/he can show most recent log. So to avoid scrolling i want to set cursor at last.
Currently i am simply using : Process.Start("notepad.exe",Path)
to open log file.
回答1:
- Once Notepad is started, find its window. You can use user32.dll.FindWindow.
- Use
SendMessage
to send WM_VSCROLL withSB_BOTTOM
parameter to this window.
来源:https://stackoverflow.com/questions/13034800/how-to-set-cursor-position-at-end-of-text-while-open-notepad-log-file