<?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[Focusing on the open document]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I’m developing a plugin to help me with my HDL/FPGA development process.</p>
<p dir="auto">For now, it just compiles the open file with the Modelsim compiler and displays the output lines in the list box of a docking dialog placed in the bottom of Notepad++: double-clicking on an item of the list box moves the cursor to the line of the open document that caused the error.</p>
<p dir="auto">For the double-clicking action, I based my code on the FunctionList code of the last version of Notepad++. The problem is, I can’t understand how to focus on the open document after I move the cursor to the right line.</p>
<p dir="auto">In Notepad++ (file PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp, line 582), it’s just:</p>
<pre><code>PostMessage(_hParent, WM_COMMAND, SCEN_SETFOCUS &lt;&lt; 16, reinterpret_cast&lt;LPARAM&gt;((*_ppEditView)-&gt;getHSelf()));
</code></pre>
<p dir="auto">My question is: how can I do the same thing from within my plugin?</p>
<p dir="auto">Thank you very much,<br />
Vince.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23844/focusing-on-the-open-document</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 06:46:14 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23844.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 Dec 2022 07:25:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Focusing on the open document on Tue, 06 Dec 2022 15:55:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> Nice. Thanks!</p>
<p dir="auto">V.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82310</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82310</guid><dc:creator><![CDATA[dipaolov]]></dc:creator><pubDate>Tue, 06 Dec 2022 15:55:10 GMT</pubDate></item><item><title><![CDATA[Reply to Focusing on the open document on Tue, 06 Dec 2022 12:33:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dipaolov" aria-label="Profile: dipaolov">@<bdi>dipaolov</bdi></a> Another solution might be <a href="https://www.scintilla.org/ScintillaDoc.html#SCI_GRABFOCUS" rel="nofollow ugc"><code>SCI_GRABFOCUS</code></a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/82301</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82301</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Tue, 06 Dec 2022 12:33:32 GMT</pubDate></item><item><title><![CDATA[Reply to Focusing on the open document on Mon, 05 Dec 2022 17:04:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mariusv-github" aria-label="Profile: mariusv-github">@<bdi>mariusv-github</bdi></a> Hi, the first solution worked. Thank you very much!</p>
<p dir="auto">Vince.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82289</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82289</guid><dc:creator><![CDATA[dipaolov]]></dc:creator><pubDate>Mon, 05 Dec 2022 17:04:55 GMT</pubDate></item><item><title><![CDATA[Reply to Focusing on the open document on Sun, 04 Dec 2022 08:10:31 GMT]]></title><description><![CDATA[<p dir="auto">Hi dipaolov,<br />
I am not sure in you case, but you can try 2 different solutions:</p>
<ol>
<li>Using the NPPM_SWITCHTOFILE NPP message with the filePahName of you opened document (<a href="https://npp-user-manual.org/docs/plugin-communication/#nppm-switchtofile" rel="nofollow ugc">https://npp-user-manual.org/docs/plugin-communication/#nppm-switchtofile</a>).</li>
<li>Using SetFocus Windows API (if you document is already at the foreground level) with the handle of the right Scintilla instance: Main/Second from NppData (<a href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus" rel="nofollow ugc">https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setfocus</a>). This second solution maybe needs to call AttachThreadInput from your plugin before SetFocus because maybe your plugin executes in a different thread than the Scintilla thread.</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/82229</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82229</guid><dc:creator><![CDATA[mariusv-github]]></dc:creator><pubDate>Sun, 04 Dec 2022 08:10:31 GMT</pubDate></item></channel></rss>