<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[NPP C# plugin - How to get the list of Notepad++&#x27;s open files.]]></title><description><![CDATA[<p dir="auto">Hi everybody,</p>
<p dir="auto">now that I’m able to compile dll I came to a point that I need a way to get the list of the files open in Notepad++.</p>
<p dir="auto">On the web I found a couple of plugins dll but I wasn’t able to get their source code.</p>
<p dir="auto">Any suggestion on how to get the list of Npp’s open files? May be a link to a C# plugin?</p>
<p dir="auto">Thank you in advance</p>
<p dir="auto">Regards<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14560/npp-c-plugin-how-to-get-the-list-of-notepad-s-open-files</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 06:28:21 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14560.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Oct 2017 12:19:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Sat, 15 Dec 2018 06:14:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a><br />
BGuenthner has good answer here for get all open files and current open files include new tab<br />
<a href="https://sourceforge.net/p/notepad-plus/discussion/482781/thread/90ae2b1a/" rel="nofollow ugc">https://sourceforge.net/p/notepad-plus/discussion/482781/thread/90ae2b1a/</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/37611</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37611</guid><dc:creator><![CDATA[rinku singh]]></dc:creator><pubDate>Sat, 15 Dec 2018 06:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Wed, 18 Oct 2017 23:33:49 GMT]]></title><description><![CDATA[<p dir="auto">I tried this with python and it is behaving the same. I don’t get an info that the call failed.<br />
I did a quick look to the npp source code and it looks like we should get the info</p>
<pre><code>	case NPPM_SAVECURRENTSESSION:
	{
		return (LRESULT)fileSaveSession(0, NULL, reinterpret_cast&lt;const TCHAR *&gt;(lParam));
	}
</code></pre>
<p dir="auto">and</p>
<pre><code>const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames, const TCHAR *sessionFile2save)
{
    if (sessionFile2save)
    {
        Session currentSession;
        if ((nbFile) &amp;&amp; (fileNames))
        {
            for (size_t i = 0 ; i &lt; nbFile ; ++i)
            {
                if (PathFileExists(fileNames[i]))
                    currentSession._mainViewFiles.push_back(generic_string(fileNames[i]));
            }
        }
        else
            getCurrentOpenedFiles(currentSession);

        (NppParameters::getInstance())-&gt;writeSession(currentSession, sessionFile2save);
        return sessionFile2save;
    }
    return NULL;
}
</code></pre>
<p dir="auto">In case of success it should return the full path, in case of error NULL.<br />
So I assume, this isn’t correctly implemented, either in python and c# plugin pack<br />
or  npp. Hmm, as I do not have a windows operating system anymore I can hardly test it. Sorry.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27489</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27489</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Wed, 18 Oct 2017 23:33:49 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Wed, 18 Oct 2017 22:38:34 GMT]]></title><description><![CDATA[<p dir="auto">You confusion comes from the fact I’m not a native english, sorry.<br />
But yes in my case sessionFilePath = “C:\text.txt” doesn’t work. It also for me a matter of permissions. Then the question is Win32.SendMessage doesn’t return a path null or empty as the file ins’t created.</p>
<p dir="auto">Thank you so much.<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27488</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27488</guid><dc:creator><![CDATA[Alessandro]]></dc:creator><pubDate>Wed, 18 Oct 2017 22:38:34 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Wed, 18 Oct 2017 22:15:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<p dir="auto">I’m a little bit confused about what is working and what doesn’t.<br />
Are you saying if you specify <strong>sessionFilePath = “C:\text.txt”</strong> it is working<br />
but if you specify <strong>sessionFilePath = “C:\Users\USR1\Desktop\text.txt"</strong><br />
it does not work?</p>
<p dir="auto">Or is it vice versa?</p>
<p dir="auto">As I’m not a csharp developer I tried this with python and both ways work for me<br />
so I have to assume that the path <strong>C:\Users\USR1\Desktop</strong> does not exist or permissions<br />
problems happen.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27487</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27487</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Wed, 18 Oct 2017 22:15:26 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Wed, 18 Oct 2017 21:51:08 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://notepad-plus-plus.org/community/user/claudia-frank" rel="nofollow ugc">@Claudia </a></p>
<p dir="auto">Can you explain me why the method <em>saveCurrentSessionDemo</em> present in the Demo NPP C# plugin, even if the <em>Win32.SendMessage</em> return the full path of the file to be saved (i.e. C:\text.txt) the file <em>text.txt</em> is not created. It happens only if the <em>static string sessionFilePath = @“C:\text.txt”</em>" and it doesn’t if *static string sessionFilePath = @“C:\Users\USR1\Desktop\text.txt”.</p>
<p dir="auto">Here is the source code of the <em>saveCurrentSessionDemo</em></p>
<p dir="auto">static void saveCurrentSessionDemo()<br />
{<br />
string sessionPath = Marshal.PtrToStringUni(Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_SAVECURRENTSESSION, 0, sessionFilePath));<br />
if (!string.IsNullOrEmpty(sessionPath))<br />
MessageBox.Show(sessionPath, “Saved Session File :”, MessageBoxButtons.OK);<br />
}</p>
<p dir="auto">Regards and thanks in advance<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27486</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27486</guid><dc:creator><![CDATA[Alessandro]]></dc:creator><pubDate>Wed, 18 Oct 2017 21:51:08 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Sat, 14 Oct 2017 19:28:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a>,</p>
<p dir="auto">my pleasure!</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27376</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27376</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Sat, 14 Oct 2017 19:28:18 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Sat, 14 Oct 2017 19:24:31 GMT]]></title><description><![CDATA[<p dir="auto">Dear Claudia,</p>
<p dir="auto">I want to thank you so much for the precious help you gave me.</p>
<p dir="auto">Everything is clear now. Right C# template, right demo project, exactly what I was looking for. The reason of the NPP’s incompatible dll message when NPP stars is now clear.</p>
<p dir="auto">I greatly appreciated your patience and  the clarity of your  explanation thanks to which I fully understood.</p>
<p dir="auto">Cheers<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27375</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27375</guid><dc:creator><![CDATA[Alessandro]]></dc:creator><pubDate>Sat, 14 Oct 2017 19:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Fri, 13 Oct 2017 13:13:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<p dir="auto">the plugin template is from kblisted as stated in your other post, to be exact it is from<br />
<a href="https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net" rel="nofollow ugc">https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net</a><br />
If you downloaded from this site you should have a Demo Plugin folder which contains the<br />
demo.cs file which itself has several SendMessage examples.</p>
<p dir="auto">The error about unicode and ansi version is coming from notepadd++.<br />
What it does is, simple explanation, notepad++ loads your plugin dll and is calling<br />
a dll function called <em><strong>isUnicode()</strong></em>. If this function returns <strong>true</strong> then npp assumes it is<br />
a valid unicode plugin. If this function cannot be called, because you didn’t implement it or it returns <strong>false</strong>, then it throws this error.<br />
The plugin template has this function already defined within <strong>UnmanagedExports.cs</strong>.</p>
<p dir="auto">Makes this sense to you?</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27342</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27342</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 13 Oct 2017 13:13:20 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Fri, 13 Oct 2017 12:54:50 GMT]]></title><description><![CDATA[<p dir="auto">I made a lot of confusion, so sorry.</p>
<p dir="auto">You didn’t suggest to download the C# template from <a href="http://file-upload.net" rel="nofollow ugc">file-upload.net</a>.<br />
Reading your kind post I thought it was right place from which download it. I was evidently wrong also because that template doesn’t work ( “This ANSI plugin is not compatible with your Unicode Notepad++” issue).</p>
<p dir="auto">Let’s start from the beginning.</p>
<p dir="auto">Can you suggest where to get the demo C# template you talked about and where you get the SendMessage example?</p>
<p dir="auto">Regards<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27341</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27341</guid><dc:creator><![CDATA[Alessandro]]></dc:creator><pubDate>Fri, 13 Oct 2017 12:54:50 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Fri, 13 Oct 2017 11:16:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<blockquote>
<p dir="auto">“This ANSI plugin is not compatible with your Unicode Notepad++”  What am I doing wrong?  Am I using the wrong C# plugin templete?</p>
</blockquote>
<p dir="auto">You also asked this SAME question in this OTHER thread:<br />
<a href="https://notepad-plus-plus.org/community/topic/14495/npp-c-plugin-template-for-unicode" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14495/npp-c-plugin-template-for-unicode</a></p>
<p dir="auto">Was <a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> 's answer in that other thread not correct or insufficient?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27340</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27340</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 13 Oct 2017 11:16:45 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Fri, 13 Oct 2017 10:08:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<p dir="auto">did I suggest to download the c# template from <a href="http://file-upload.net" rel="nofollow ugc">file-upload.net</a>? I don’t think so.<br />
From the wiki that you refer to</p>
<p dir="auto">The Common Plugin Interface<br />
bool isUnicode()<br />
A plugin is designed to either work with an ANSI or Unicode build of Notepad++. ANSI plugins must not define this function. Unicode plugins must define it, and it must return true.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27338</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27338</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 13 Oct 2017 10:08:39 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Fri, 13 Oct 2017 06:51:47 GMT]]></title><description><![CDATA[<p dir="auto">As suggested by Claudia Frank I dowloaded the C# plugin templete from <a href="http://www.file-upload.net/download-2120709/NppPlugin.NET.v0.3.7z.html" rel="nofollow ugc">here</a> (I found in <a href="http://docs.notepad-plus-plus.org/index.php?title=Plugin_Development" rel="nofollow ugc">Notepad++ Wiki web site</a>).</p>
<p dir="auto">Unlikely once copied the its dll templete in the NPP plugin folder (C:\Program Files (x86)\Notepad++\plugins) when Notepad++ starts a message box appears saying that</p>
<p dir="auto">“This ANSI plugin is not compatible with your Unicode Notepad++”</p>
<p dir="auto">What am I doing wrong?<br />
Am I using the wrong C# plugin templete?</p>
<p dir="auto">Cheers<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27336</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27336</guid><dc:creator><![CDATA[Alessandro]]></dc:creator><pubDate>Fri, 13 Oct 2017 06:51:47 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Mon, 02 Oct 2017 14:26:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<p dir="auto">from the demo</p>
<pre><code>StringBuilder sbIniFilePath = new StringBuilder(Win32.MAX_PATH);
Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_GETPLUGINSCONFIGDIR, Win32.MAX_PATH, sbIniFilePath);
iniFilePath = sbIniFilePath.ToString();
</code></pre>
<p dir="auto">instead of using NPPM_GETPLUGINSCONFIGDIR you use the NPPM_GETNBOPENFILES<br />
and the required parameters.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27102</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27102</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Mon, 02 Oct 2017 14:26:51 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Mon, 02 Oct 2017 14:22:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<p dir="auto">I might be wrong but I thought there is demo included in the c# template, isn’t it?<br />
If it is search for something like SendMessage.<br />
I assume you need to provide the npp handle and then the message id and parameters if used.<br />
It could be that the demo only uses scintilla message but the technique is the same.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27101</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27101</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Mon, 02 Oct 2017 14:22:26 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Mon, 02 Oct 2017 14:16:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/claudia-frank" aria-label="Profile: Claudia-Frank">@<bdi>Claudia-Frank</bdi></a></p>
<p dir="auto">Thank you for the suggestion. I read the content of your link understanding the meaning of messages and notifications Notepad++ exchanges with or forwards to plugins.</p>
<p dir="auto">Nevertheless having a C# example code it should of great help .</p>
<p dir="auto">Cheers<br />
Alessandro</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27099</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27099</guid><dc:creator><![CDATA[Alessandro]]></dc:creator><pubDate>Mon, 02 Oct 2017 14:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to NPP C# plugin - How to get the list of Notepad++&#x27;s open files. on Mon, 02 Oct 2017 13:37:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alessandro" aria-label="Profile: Alessandro">@<bdi>Alessandro</bdi></a></p>
<p dir="auto">you need to send NPPM_GETNBOPENFILES message.<br />
See <a href="http://docs.notepad-plus-plus.org/index.php/Messages_And_Notifications" rel="nofollow ugc">here</a>  for more<br />
information how to use the messages.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27088</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27088</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Mon, 02 Oct 2017 13:37:46 GMT</pubDate></item></channel></rss>