【问题标题】:Notepad++ plugin find end of file and full path?Notepad ++插件找到文件结尾和完整路径?
【发布时间】:2014-06-28 02:10:49
【问题描述】:

如何通过在 c# 中为 notepad++ 编写插件,在 scintilla 文档中找到文件结尾和完整文件路径。我尝试了以下代码:

    string nEnd;
    Win32.SendMessage(nppHandle, NppMsg.NPPM_GETFULLCURRENTPATH, 0, out nEnd);

但我没有输出字符串值的 SendMessage 方法..
对于文件末尾我没有找到 NppMsg,有没有人或者我应该如何管理它?
我想在文件末尾自动写入。

【问题讨论】:

    标签: plugins notepad++ scintilla


    【解决方案1】:

    对于完整路径,请使用 StringBuilder

            StringBuilder path = new StringBuilder(Win32.MAX_PATH);
            Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_GETFULLCURRENTPATH, 0, path);
            MessageBox.Show("path : " + path);
    

    【讨论】:

      【解决方案2】:

      终于找到了找到文档结尾的方法:

          Win32.SendMessage(pCurScintilla, SciMsg.SCI_DOCUMENTEND, 0, 0);          
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-12-21
        • 2011-02-02
        • 2010-09-16
        • 2021-04-24
        • 2016-03-21
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多