<?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[Interact on oppening file]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I’ve maid a plugin that verify if you can open a file ( you have a message box if an other user has oppened it). It’s ok for this but now I want to propose to the user if he want to open the file in read only or not to pen this file.<br />
I tried to use :<br />
unsigned long ret = SendMessage(nppHandle, NPPM_MENUCOMMAND, 0, IDM_EDIT_CLEARREADONLY);<br />
and<br />
unsigned long ret = SendMessage(nppHandle, NPPM_MENUCOMMAND, 0, IDM_EDIT_CLEARREADONLY);<br />
in the NPPN_FILEOPENED procedure but it does noithing<br />
How can this things works ?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12856/interact-on-oppening-file</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 09:53:30 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12856.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Dec 2016 11:37:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Interact on oppening file on Fri, 09 Dec 2016 15:38:16 GMT]]></title><description><![CDATA[<p dir="auto">Nice to see that I’m not the only one whose “clear view” depends on coffee consumption :-D<br />
Just ready for another cup …</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19813</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19813</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 09 Dec 2016 15:38:16 GMT</pubDate></item><item><title><![CDATA[Reply to Interact on oppening file on Fri, 09 Dec 2016 15:32:45 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">I would suggest you use buffer activated notification…</p>
</blockquote>
<p dir="auto">Ah yes! Don’t know why I didn’t think of that (not enough coffee probably) but that would probably be the best in the end anyways.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19812</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19812</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Fri, 09 Dec 2016 15:32:45 GMT</pubDate></item><item><title><![CDATA[Reply to Interact on oppening file on Thu, 08 Dec 2016 21:31:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yunatane-gris-fond" aria-label="Profile: Yunatane-Gris-Fond">@<bdi>Yunatane-Gris-Fond</bdi></a></p>
<p dir="auto">from what I remember, I once checked this out and hope it is still the status quo, the read only story is the following.<br />
As dail already pointed out, there are two read only functions which do different things.<br />
The toggle function set-read-only and the clear-read-only function.<br />
The first doesn’t change the file attribute where as the latter clears it (but cannot set it).<br />
Set-read-only just toggles the write state from ui point of view and npp (better scintilla) does or does not allow<br />
to overwrite the current file.<br />
Clear-Read-Only can, as the name already suggest, only clear the <strong>os file permission flag</strong>  but cannot set it.</p>
<p dir="auto">In regards to your problem, it seems that that the notification is already sent before file has been loaded into<br />
scintilla buffer completely. I would suggest you use buffer activated notification in addition to set the read-only ui flag.<br />
From previous testing it looks like that this notification always arrives after buffer has been loaded completely.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19795</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19795</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Thu, 08 Dec 2016 21:31:12 GMT</pubDate></item><item><title><![CDATA[Reply to Interact on oppening file on Thu, 08 Dec 2016 14:21:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yunatane-gris-fond" aria-label="Profile: Yunatane-Gris-Fond">@<bdi>Yunatane-Gris-Fond</bdi></a></p>
<p dir="auto">You are correct that it doesn’t look like using IDM_EDIT_SETREADONLY works for some reason during NPPN_FILEOPENED. For me it partially works but I can’t find any repeatable behavior. I can’t think of another good way to try to fix it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19789</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19789</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Thu, 08 Dec 2016 14:21:12 GMT</pubDate></item><item><title><![CDATA[Reply to Interact on oppening file on Thu, 08 Dec 2016 13:50:32 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for answering, I’m now able to set readonlyfile (Npp flag only) on a file already open but I can’t do it on openning. I’ve tried to call a function via a thread (I’m in C#) but I have error maybe about static declaration. Is there anyone who use thread or just have been able to set<br />
Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MENUCOMMAND, 0, NppMenuCmd.IDM_EDIT_SETREADONLY); on an oppening file ?.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19787</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19787</guid><dc:creator><![CDATA[Yunatane Gris Fond]]></dc:creator><pubDate>Thu, 08 Dec 2016 13:50:32 GMT</pubDate></item><item><title><![CDATA[Reply to Interact on oppening file on Mon, 05 Dec 2016 14:40:20 GMT]]></title><description><![CDATA[<p dir="auto">Although I don’t have any exact answers, I may be able to provide a few hints to help you. I spent a couple minutes messing around calling some of the menu commands from a script…</p>
<p dir="auto">There are 2 “read only” flags you need to keep in mind. There is one that is associated with the Windows operating system (meaning Windows will not allow the file to be overwritten, etc). There is also a “read only” flag within Notepad++, meaning that the file can be overwritten on the actual hard drive, but Notepad++ won’t allow it to be edited in the editor. (See <a href="http://www.scintilla.org/ScintillaDoc.html#SCI_SETREADONLY" rel="nofollow ugc">SCI_SETREADONLY</a> for reference.) I’m not sure which flags (maybe both?) get set when calling <code>IDM_EDIT_CLEARREADONLY</code> and <code>IDM_EDIT_SETREADONLY</code>.</p>
<p dir="auto">It looks like using <code>IDM_EDIT_SETREADONLY</code> <em>toggles</em> the read only flag (again not sure exactly which flag).</p>
<p dir="auto">I’m not 100% sure what <code>IDM_EDIT_CLEARREADONLY</code> does.</p>
<p dir="auto">There might a problem setting the read only status during the <code>NPPN_FILEOPENED </code> notification. Notepad++ might mess with the read only flag after it has sent your plugin this notification.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/19701</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/19701</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Mon, 05 Dec 2016 14:40:20 GMT</pubDate></item></channel></rss>