<?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[How to get text and/or scintilla handle for background file?]]></title><description><![CDATA[<p dir="auto">I fear I may have a pretty difficult problem.</p>
<p dir="auto">I’m writing a plugin and I need to get the text of all files when notepad++ open and track their changes. The problem is that when a file is opened it is not the “current Scintilla” when the NPPN_FILEOPENED notification is sent (unless it was the first file opened when you start NPP). Replace across documents also causes problems, background files are obviously not the current Scintilla (in fact, calling NPPM_GETCURRENTSCINTILLA during a multi-document replace seems to return -1 for all documents, even the one currently in view).</p>
<p dir="auto">I’ve done a lot of digging around the Scintilla documentation and the NPP source code. I see that Scintilla has a notion of a Document, if I had one of these I could create a new Scintilla (using NPPM_CREATESCINTILLAHANDLE) referencing the background document use that to get the text. NPP does this in some of it’s functions that manipulate files in the background, including the function to load a file. NPP itself has a notion of a Buffer, which contains a reference to the backing Document. During the NPPN_FILEOPENED I can get the Buffer ID for the background document (I also use this to get the filename), but I don’t see anyway to go from a Buffer ID to a Document from the context of a plugin.</p>
<p dir="auto">In short, what I need is a way to get the text, or preferably a Scintilla handle, for a background file. Does anyone know how to tackle this problem?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20207/how-to-get-text-and-or-scintilla-handle-for-background-file</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 05:49:53 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20207.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Oct 2020 08:47:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 22:02:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a><br />
I was not replying to you. But I considered some more later. Would it be  a safe feature, and should the developers consider whether such feature could be exploited by malicious softwares? Maybe it’s an unsafe plus an useless feature. So, just let it be.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64947</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64947</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 22:02:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 21:39:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a> said in <a href="/post/64945">How to get text and/or scintilla handle for background file?</a>:</p>
<blockquote>
<p dir="auto">But if you want a quick working example</p>
</blockquote>
<p dir="auto">I don’t want it.  If you want the feature, you have to make a feature request.  After you make a feature request, explain <em>there</em> how you think it should be implemented.  Or better, do an actual pull request to ask to have your code put directly into the notepad++ source code.</p>
<p dir="auto">This forum doesn’t change the codebase.  Telling me how to do it won’t help anybody, because I am not one of the developers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64946</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64946</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 13 Apr 2021 21:39:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 21:26:52 GMT]]></title><description><![CDATA[<p dir="auto">Getting background text shouldn’t be too difficult, if not easy. You need to deal with pointers, and various encodings. But if you want a quick working example to proof your concept, you can modify the NPP source code, like below:</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64945</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64945</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 21:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 21:20:30 GMT]]></title><description><![CDATA[<p dir="auto">Saying “this person and its crap” are direct insults. I agree and regret.</p>
<p dir="auto">I am interested in how to integrate IE control in a win32 plugin and display in-memory contents ( in this case scintilla buffers ). It seems that the existing HTML previewer is written in Delphi. Delphi is completely strange to me.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64944</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64944</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 21:20:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:58:49 GMT]]></title><description><![CDATA[<p dir="auto">I’ve mixed you two  ( PeterJones  and Alan Kilborn ) into one. I thought I was talking to one person…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64943</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64943</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:44:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a> said in <a href="/post/64929">How to get text and/or scintilla handle for background file?</a>:</p>
<blockquote>
<p dir="auto">You words are so long and I can bearly understand all of them. XD</p>
</blockquote>
<p dir="auto">Are you saying I use words with too many letters in them?  Or that I string together too many words?</p>
<p dir="auto">I will admit that I am wordy.  I do that to try to eliminate ambiguity and make things clear.  If you aren’t a native English speaker, then maybe my sentence structure becomes too complex.  (But I know there are forum regulars who are non-native English speakers, so it’s not impossible to understand me.  <a href="http://deepl.com" rel="nofollow ugc">deepl.com</a> has a translator that some think does a better job that google translate, if you are looking for recommendations.)  I find that if I try to limit myself to short sentences, it does not accurately convey my ideas.</p>
<p dir="auto">But I will try:</p>
<p dir="auto">You appear to have some coding skills.<br />
You claim to know how to do this easily.<br />
What stops you from putting in a feature request?<br />
What stops you from putting in a pull request?</p>
<p dir="auto">Direct insults are <em>not</em> tolerated in this forum.  Saying “some alien person” or “this person and its crap” are direct insults.  Direct insults will be downvoted.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64942</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64942</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:44:10 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:43:28 GMT]]></title><description><![CDATA[<p dir="auto">Even you are allowed to express your opinion this forum, glad to know!</p>
<blockquote>
<p dir="auto">It’s a shame because you probably have some good ideas to share.</p>
</blockquote>
<p dir="auto">What’s your shame, why did you blame me?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64941</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64941</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:43:28 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:35:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a> said in <a href="/post/64935">How to get text and/or scintilla handle for background file?</a>:</p>
<blockquote>
<p dir="auto">just leave and dont reply if you don’t like @Derek Brown’s ideas</p>
</blockquote>
<p dir="auto">People are allowed to express their opinion in this forum, even you.</p>
<p dir="auto">And, as a reminder,</p>
<ul>
<li>if you have a feature request, this forum is not the place to make it official.  You can repeat loudly about how easy it is to implement to your heart’s content, but if there hasn’t been an official feature request in the github, it is not official and nothing will be done about it.</li>
<li>if you have the skills to implement such a fix easily – and you have now claimed that you do – then implement it and provide a Pull Request to get it incorporated</li>
<li>if you have the skills but are unwilling to do the work, then it is your own fault the codebase isn’t updated</li>
</ul>
<p dir="auto">It’s now up to you: either put in the feature request, preferrably with a suggested implementation, or it’s your own fault that nothing has happened.  Either way, you need to understand that no amount of arguing with the forum regulars here in a discussion forum will accomplish anything other than to annoy readers of this discussion.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64940</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64940</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:35:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:33:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> Yep, you continue to reply your none-constructive words; anyone else make any sense out of what this persn and it’s crap?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64939</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64939</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:33:32 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:29:52 GMT]]></title><description><![CDATA[<p dir="auto">Some alien person:</p>
<blockquote>
<p dir="auto">Why does anyone care about this ( the video )?</p>
</blockquote>
<p dir="auto">This guy has never understood the subject of this article. The video accurately demostrates the possibility of “getting text and/or scintilla handle for background file”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64937</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64937</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:29:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:31:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a></p>
<p dir="auto">Yep, you continue to make zero sense, as far as I can see; anyone else make any sense out of what this person is saying?<br />
It’s a shame because you probably have some good ideas to share.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64936</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64936</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:31:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 20:28:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a><br />
You are being off-topic for your comments. just leave and dont reply if you don’t like @Derek Brown’s ideas about <strong>NotepadPlusplus</strong> and <strong>scintilla</strong> .</p>
<p dir="auto">Well , I styled my text this time, if you say.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64935</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64935</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 20:28:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 18:09:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a> said in <a href="/post/64929">How to get text and/or scintilla handle for background file?</a>:</p>
<blockquote>
<p dir="auto">You words are so long and I can bearly understand all of them.</p>
</blockquote>
<p dir="auto">Oh, boy.  LOL</p>
<blockquote>
<p dir="auto">Here is a short video of what it shall look like</p>
</blockquote>
<p dir="auto">Why does anyone care about this?</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a> I’ve read a good number of your postings here, as well as on github, and I’m left with, well, a general feeling of confusion about what you are trying to communicate, in pretty much all of your postings.</p>
<p dir="auto">At least <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> writes with a style and length to make his information understandable.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64930</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64930</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 13 Apr 2021 18:09:53 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Tue, 13 Apr 2021 16:58:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">You words are so long and I can bearly understand all of them. XD</p>
<p dir="auto">Anyway , when I am saying something is easy to achieve, I probably have already achieved such goals or at least some working prototypes, that’s my style.</p>
<p dir="auto">Here is a short video of what it shall look like —— <a href="https://drive.google.com/file/d/1qBf4_MPvZrtBOF3xBPMq2uwm80e0B85k/view?usp=sharing" rel="nofollow ugc">the two “chained updating” demo</a>. In the example, when the shader source file is modified, the web-based shadertory preview updates immediately.</p>
<p dir="auto">Please, don’t let the imagination limit you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64929</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64929</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Tue, 13 Apr 2021 16:58:05 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Sun, 11 Apr 2021 17:41:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/knifer" aria-label="Profile: KnIfER">@<bdi>KnIfER</bdi></a></p>
<blockquote>
<p dir="auto">A HTML previewer plugin requires such feature</p>
</blockquote>
<p dir="auto">The existing Preview HTML plugin works just fine as is, because expecting that the user saves ancilliary files (like a CSS file accompanying an HTML file) is not an onerus expectation of the user.</p>
<blockquote>
<p dir="auto">It’s easy to implement in the source code.</p>
</blockquote>
<p dir="auto">Like other regulars on this forum, I am amazed at how often phrases like that are bandied about.  If you have the skills to implement such a fix easily, then implement it and provide a Pull Request to get it incorporated; if you have the skills but are unwilling to do the work, then it is your own fault the codebase isn’t updated; if you don’t have the skills, then you are not actually in a position to judge how easy or difficult the task might be.</p>
<p dir="auto">Besides, you have been here long enough to know (or at least long enough to have had opportunity to learn) that if you have a feature request, this forum is not the place to make it official.  You can discuss topics here, and we’re happy to answer if we know such a feature already exists or suggest workarounds if they don’t; and it’s a great place for finding out if others think your feature request is a good idea or not; but in the end, if no one has put in an official feature request, as <a href="/topic/15741/faq-desk-feature-request-or-bug-report">explained</a> in one of <a href="/category/7/faq">this forum’s FAQs</a>, then it’s just discussion and <em>not</em> an official request.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64864</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64864</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 11 Apr 2021 17:41:36 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Sun, 11 Apr 2021 03:40:59 GMT]]></title><description><![CDATA[<p dir="auto">Hack? It’s easy to implement in the source code.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64855</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64855</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Sun, 11 Apr 2021 03:40:59 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Sun, 25 Oct 2020 04:12:44 GMT]]></title><description><![CDATA[<p dir="auto">I’m hoping that someone might know a clever workaround or hack, or that I might have missed something.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59030</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59030</guid><dc:creator><![CDATA[Derek Brown]]></dc:creator><pubDate>Sun, 25 Oct 2020 04:12:44 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Sat, 24 Oct 2020 23:08:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/derek-brown" aria-label="Profile: Derek-Brown">@<bdi>Derek-Brown</bdi></a></p>
<p dir="auto">Afaik, there is no direct way to read the loaded buffers.<br />
Sorry for the confusion, but I thought this was clear and you are looking for an alternative.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59025</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59025</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Sat, 24 Oct 2020 23:08:14 GMT</pubDate></item><item><title><![CDATA[Reply to How to get text and/or scintilla handle for background file? on Sat, 24 Oct 2020 22:31:15 GMT]]></title><description><![CDATA[<p dir="auto">I’m not sure I follow you. Are you suggesting to use the filename to read the file directly (using Windows APIs or something)? That won’t always work: If session backups are enabled you can have an unsaved new file backed up. When you restart NPP it’s filename will be something like “new 1”, not an actual file on disk (I’m sure the backup file exists somewhere, but the filename does not point you to it). Likewise, if an existing file is unsaved then the contents that are opened when you restart NPP will be different from the contents on disk at the given filename.</p>
<p dir="auto">And sure you could compare what you loaded from disk with the contents of the buffer when it becomes active, but then I may as well just wait until the buffer is active to read anything at all. And I could write my plugin this way, but it would be much better and simpler if I could track the state of all buffers whether they were active or not.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/59023</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/59023</guid><dc:creator><![CDATA[Derek Brown]]></dc:creator><pubDate>Sat, 24 Oct 2020 22:31:15 GMT</pubDate></item></channel></rss>