How to set cursor position at end of text while open notepad (log file)?

不打扰是莪最后的温柔 提交于 2021-02-11 17:37:45

问题


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:


  1. Once Notepad is started, find its window. You can use user32.dll.FindWindow.
  2. Use SendMessage to send WM_VSCROLL with SB_BOTTOM parameter to this window.


来源:https://stackoverflow.com/questions/13034800/how-to-set-cursor-position-at-end-of-text-while-open-notepad-log-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!