<?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[Keyboard shortcut for next&#x2F;previous incremental search result?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I find incremental search very useful and I almost always use it instead of the normal ‘Find’. However, I have a habit of doing an incremental search for certain text, then closing the incremental search bar, doing some writing, and then pressing F3/Shift-F3 (Next/Previous search result), expecting to go to the next/previous result based on what I entered in the incremental search bar; however, this actually just goes to the next/previous result from whatever the last regular ‘Find’ search I did was.</p>
<p dir="auto">Is there any way to use a shortcut that goes to the next/previous result of my incremental search, without having to re-open the window? Re-opening the bar, going to the next result, then closing it back again, adds two extra steps (opening + closing the bar) which it would be nice to eliminate…</p>
<p dir="auto">Thanks :)</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14271/keyboard-shortcut-for-next-previous-incremental-search-result</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 00:17:54 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14271.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Aug 2017 22:17:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Sat, 21 Oct 2017 18:53:16 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@scott-sumner</a> and <strong>All</strong>,</p>
<p dir="auto">I did some tests and it happens that the <strong>double</strong> hit on the <strong>Windows logo</strong> key allows to put the focus <strong>back</strong> on the main editor windows, again, if a window can be <strong>anchored</strong> to the <strong>main editor</strong> windows, at its <strong>right</strong>, <strong>left</strong>, <strong>top</strong> or <strong>bottom</strong> side</p>
<p dir="auto">So, it concerns, from <strong>native</strong> N++, the <strong>Character Panel</strong>, <strong>Clipboard History</strong>, <strong>Search Results</strong>, <strong>Project</strong>, <strong>Folder as Workspace</strong> and the <strong>Function List</strong> windows, as well as most of <strong>plugin</strong>’s windows as, for instance, the <strong>Python or Lua console</strong> window !</p>
<p dir="auto">However, just note that if any of these <strong>“dockable”</strong> panels is <strong>not</strong> docked and is, simply, <strong>floating</strong> like a <strong>separate</strong> windows, the <strong>double</strong> hit on the <strong>Windows logo</strong> key does <strong>not</strong> allow, anymore, to have the <strong>focus</strong> back, on the <strong>main editor</strong> windows !</p>
<p dir="auto">Strangely, it does <strong>not</strong> work too, with the <strong>Document Map</strong> panel, which, however, can be <strong>anchored</strong> !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27538</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27538</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 21 Oct 2017 18:53:16 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Sat, 21 Oct 2017 12:51:29 GMT]]></title><description><![CDATA[<p dir="auto">The double-Windows-key works because when Notepad++ becomes the active application (second Windows logo keypress), focus is moved back to the current document tab if it was not there when N++ ceased being the active app.  This seems to always be the case…</p>
<p dir="auto">So another easy(?) keyboard option is to hold Alt+Tab and at the same time tap Esc!  :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27537</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27537</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 21 Oct 2017 12:51:29 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 19:21:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> said:</p>
<blockquote>
<p dir="auto">just hit the Win Logo key, twice</p>
</blockquote>
<p dir="auto">Works for me on Windows 7 Enterprise SP1 64-bit, running Notepad++ 32-bit!</p>
<p dir="auto">The double hit of the Windows logo key also more efficiently (less keystrokes) solves the problem from this thread:  <a href="https://notepad-plus-plus.org/community/topic/12467/keystroke-to-switch-focus-from-console-window-to-active-editor-tab" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/12467/keystroke-to-switch-focus-from-console-window-to-active-editor-tab</a>, although I’ll only use this new way interactively (and will keep the existing SendKeys-based solution in my <a href="http://startup.py" rel="nofollow ugc">startup.py</a>).</p>
<p dir="auto">I like it!  :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27525</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27525</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 20 Oct 2017 19:21:51 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Wed, 23 Nov 2022 14:51:47 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/4840">@andrew</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/10164">@stefan-boeters</a>, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@scott-sumner</a> and <strong>All</strong>,</p>
<p dir="auto">I simply asked myself the <strong>question</strong> :</p>
<p dir="auto">How to have the <strong>editor</strong> window and the <strong>incremental search</strong> window present, at the <strong>same</strong> time and <strong>switch</strong> from one to the other, with a <strong>keyboard</strong> shortcut ? I found out a <strong>weird</strong> way to do it but, at least, it seems to work !</p>
<hr />
<p dir="auto">I supposed that you <strong>previously</strong> got the <strong>incremental search</strong> windows, hitting the <strong><code>Alt + Ctrl + I</code></strong> shorctut, <strong>once</strong> :</p>
<p dir="auto">Now :</p>
<ul>
<li>
<p dir="auto">To move from the <strong>incremental search</strong> window to the <strong>main editor</strong> window, just hit the <strong>Win Logo</strong> key, <strong><code>twice</code></strong> :</p>
<ul>
<li>
<p dir="auto">a <strong>first</strong> hit on the <strong>Win logo</strong> key, to get the <strong>Start</strong> menu</p>
</li>
<li>
<p dir="auto">a <strong>second</strong> hit, on the <strong>Win logo</strong> key, to close the <strong>Start</strong> menu</p>
</li>
</ul>
</li>
</ul>
<p dir="auto">As a result, the <strong>focus</strong> should be on the <strong>current editor</strong> window, with the <strong>cursor</strong> at its <strong>present</strong> location :-))</p>
<ul>
<li>To move from the <strong>main editor</strong> window to the <strong>incremental search</strong> window, simply hit, again, the <strong><code>Alt + Ctrl + I</code></strong> shorctut</li>
</ul>
<p dir="auto">And so on…</p>
<p dir="auto">This method works <strong>nice</strong> on my [ old ] <strong>Wind XP</strong> laptop ! Just <strong>verify</strong> that it’s the same, on <strong>newer</strong> Windows OS ?!</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto"><strong>ONCE</strong> the <strong>focus</strong> is on the <strong>incremental search</strong> window :</p>
<ul>
<li>
<p dir="auto">Press the <strong><code>Tab</code></strong> key, to cycle through the <strong>six</strong> zones ( <strong>Find</strong> zone, <strong>&lt;</strong> and <strong>&gt;</strong> buttons, <strong>Highlight all</strong> and <strong>Match case</strong> options , button <strong>X</strong> )</p>
</li>
<li>
<p dir="auto">Press the <strong><code>Shift + Tab</code></strong> shortcut, to cycle, in <strong>reverse</strong> order</p>
</li>
<li>
<p dir="auto">To <strong>set/unset</strong> the <strong>Highlight all</strong> or <strong>Match case</strong> options, you may, either :</p>
<ul>
<li>
<p dir="auto">From any location, hit the <strong><code>Alt + H</code></strong> or <strong><code>Alt + C</code></strong> shortcuts</p>
</li>
<li>
<p dir="auto">From the <strong>exact</strong> location, just hit the <strong>Space</strong> key</p>
</li>
</ul>
</li>
<li>
<p dir="auto">When a direction is chosen ( <strong><code>&lt;</code></strong> or <strong><code>&gt;</code></strong> ), just press the <strong><code>Enter</code></strong> key, to go on searching, in the <strong>same</strong> direction</p>
</li>
<li>
<p dir="auto">And, of course, hitting the <strong><code>Escape</code></strong> key, close the <strong>incremental search</strong> window !</p>
</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/27524</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27524</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 23 Nov 2022 14:51:47 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 15:06:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/10164">@Stefan-Boeters</a></p>
<p dir="auto">Yea…that was just my little technique to not have 2 files that differed only by one little thing–even having 2 identical files is not the best idea…  It would be nice if you could pass arguments to pythonscripts or somehow know which keycombo invoked them, but this is not currently possible.  [Actually both things are possible but not easy so I’ll just leave it there.]  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27521</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27521</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 20 Oct 2017 15:06:24 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 14:37:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@Scott-Sumner</a></p>
<p dir="auto">Strangely enough, “FindPrev” works perfect in this way, whereas “FindNext” doesn’t.</p>
<p dir="auto">I’ve adjusted the following line in the script of “FindNext”:</p>
<pre><code>caption_of_button_to_press = '&gt;' if 'FindNext' in currently_running_pythonscript else '&lt;'
</code></pre>
<p dir="auto">to become</p>
<pre><code>caption_of_button_to_press = '&gt;'
</code></pre>
<p dir="auto">(Actually you don’t need any experience with Python to do this). Now it works.</p>
<p dir="auto">This suggests that I had somehow misspelled the file name, but as far as I can see, I hadn’t. Anyway, with this (admittedly ugly) fix it does work for me. Thanks a lot. Even after this cumbersome start, the investment will pay off in the long run.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27520</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27520</guid><dc:creator><![CDATA[Stefan Boeters]]></dc:creator><pubDate>Fri, 20 Oct 2017 14:37:53 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 13:57:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/10164">@Stefan-Boeters</a> said:</p>
<blockquote>
<p dir="auto">The first hit does not satisfy you, so you want the next one. This is while you are still in Incremental Search window</p>
</blockquote>
<p dir="auto">In this situation, just hit the Enter key.  It will move the selection the the <em>next</em> match in the editor tab without leaving the Incremental Search pane.</p>
<p dir="auto">OR</p>
<p dir="auto">Press Esc (which closes the Incremental Search pane) and returns input focus to the document tab you were on when you invoked the Incremental Search, leaving you ready to press:</p>
<ul>
<li>Ctrl+Shift+. (my shortcut, YSMV) to move the selection to the <em>next</em> match</li>
<li>Ctrl+Shift+, (my shortcut, YSMV) to move the selection to the <em>previous</em> match</li>
</ul>
<p dir="auto">[YSMV = Your Shortcut May Vary]</p>
<p dir="auto">Note:  You can’t run a PS from an assigned shortcut when the Incr Seach pane has input focus.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27519</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27519</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 20 Oct 2017 13:57:30 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 13:49:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/10164">@Stefan-Boeters</a> said:</p>
<blockquote>
<p dir="auto">Is there anyone who has tried this as well?</p>
</blockquote>
<p dir="auto">I just tried the following series of steps:</p>
<ul>
<li>grab N++ 7.5.1 portable install; unzip it</li>
<li>add Plugin Manager (ugh! and double-ugh!) by manual copying from my normal N++ install that I use normally</li>
<li>run virgin 7.5.1 (with Plugin Mgr addition)</li>
<li>install PS 1.0.8 via Plugin Mgr</li>
<li>change PS config to be AT STARTUP instead of LAZY</li>
<li>add the 2 scripts by copying text out of the code window from above in this thread, naming the files the same as indicated above</li>
<li>in PS Configuration, add the 2 scripts so that they can be found by Shortcut Mapper</li>
<li>in Shortcut Mapper, bind the “next” script to Ctrl+Shift+. (period)</li>
<li>in Shortcut Mapper, bind the “prev” script to Ctrl+Shift+, (comma)</li>
<li>invoke Incremental Search by pressing Ctrl+Alt+i</li>
<li>put some text in the Find: box and press Enter</li>
<li>press Esc (input focus is now back in doc I’m editing)</li>
<li>press Ctrl+Shift+, and verify <strong>selection changes to previous occurrence of my Find: text – IT DID!</strong></li>
<li>press Ctrl+Shift+. and verify <strong>selection changes to next occurrence of my Find: text – IT DID!</strong></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/27518</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27518</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 20 Oct 2017 13:49:22 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 13:48:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/374">@Scott-Sumner</a></p>
<p dir="auto">This is a subtlety I hadn’t paid attention to before. Now that I think about it, the following seems the “minimum keystrokes” solution to me:</p>
<ul>
<li>You are in the document window in which you want to perform the search.</li>
<li>You type (Ctrl+Alt+I) for opening the Incremental Search window (which you need anyway to type the text you are searching for).</li>
<li>The first hit does not satisfy you, so you want the next one. This is while you are still in Incremental Search window, indeed.</li>
</ul>
<p dir="auto">Do you happen to have time for modification of the script along this line? I have no experience with Python whatever, nor with coding this type of scripts anyway, so I’m afraid that modifying it myself is not an option.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27517</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27517</guid><dc:creator><![CDATA[Stefan Boeters]]></dc:creator><pubDate>Fri, 20 Oct 2017 13:48:58 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 13:24:53 GMT]]></title><description><![CDATA[<p dir="auto">OK, I see. I’ve now:</p>
<p dir="auto">(1) Installed the Python Script plugin,<br />
(2) Copied the Python scripts in the /plugins/PhytonScript/scripts folder<br />
(3) Added the scripts in Plugins --&gt; Phyton Script --&gt; Configuration to the menu items<br />
(4) Assigned shortcuts in Settings --&gt; Shortcut Mapper --&gt; Plugin Commands</p>
<p dir="auto">It works – but only partly. This is what happens:</p>
<ul>
<li>When I open a file, open the incremental search window, search (ordinarily) for a text en then use the shortcuts for “FindNext” and “FindPrev”, nothing happens.</li>
<li>If I invoke the scripts via Plugins --&gt; Python Scripts (rather than via shortcuts), one of them (“FindPrev”) does work, the other (“FindNext”) doesn’t.</li>
<li>If I use the shortcuts after the first call (via Plugins --&gt; Python Scripts), “FindPrev” continues to work, but “FindNext” doesn’t.</li>
</ul>
<p dir="auto">This has nothing to do with the specific shortcuts I use. I have changed both shortcuts for testing, and the result was the same.</p>
<p dir="auto">Is there anyone who has tried this as well? Is this an idiosyncrasy of my configuration or a general problem with Scott’s script?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27515</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27515</guid><dc:creator><![CDATA[Stefan Boeters]]></dc:creator><pubDate>Fri, 20 Oct 2017 13:24:53 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 11:31:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/10164">@Stefan-Boeters</a> said:</p>
<blockquote>
<p dir="auto">what I need: shortcuts for find next (and previous) in incremental search</p>
</blockquote>
<p dir="auto">If I interpret you literally then I think you mean you need keyboard shortcuts for these functions <em><strong>without leaving the incremental search window</strong></em>.  The script above works only when the input focus is on a document tab window.  Of course it could be changed to work when the input focus is in other places…  But maybe that isn’t what you mean at all…hard to tell.  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27511</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27511</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Fri, 20 Oct 2017 11:31:42 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 10:56:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/10164">@Stefan-Boeters</a></p>
<p dir="auto">python scripts which need to interact with notepad++ do require <a href="http://npppythonscript.sourceforge.net/" rel="nofollow ugc">python script plugin</a>. Available  for 32bit version only.</p>
<p dir="auto">Once installed you need to create a new script by using the python script plugin menu,<br />
copy the code into it, save it. Goto python script plugin configuration menu and put the newly created script to the menu items. Close. Now you can assign a shortcut,</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27509</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27509</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Fri, 20 Oct 2017 10:56:00 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Fri, 20 Oct 2017 07:53:24 GMT]]></title><description><![CDATA[<p dir="auto">I was happy to find this thread because this is precisely what I need: shortcuts for find next (and previous) in incremental search. However, I failed implementing Scott’s suggestion.</p>
<p dir="auto">I created the two identical Phyton scripts with different names and saved them in the Notepad++ program folder under  Notepad++/keyboard_shortcuts. (Or need I to place them at a different place?)</p>
<p dir="auto">Then I opened “Settings” --&gt; “Shortcut mapper” in Notepad++, but I was not able to find any option to add, run or link the scripts I had created. What do I miss?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27508</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27508</guid><dc:creator><![CDATA[Stefan Boeters]]></dc:creator><pubDate>Fri, 20 Oct 2017 07:53:24 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Tue, 15 Aug 2017 15:39:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/4840">@Andrew</a></p>
<p dir="auto">Ah, that makes sense about the Esc key…</p>
<p dir="auto">If you’re willing to set up and use the Pythonscript plugin, I’ve created a solution that will allow assignments of keyboard shortcuts to do the next/previous-incremental-search-result functionality directly from the current editor window.</p>
<p dir="auto">Note that I didn’t do it for YOU…I thought about it after reading your post, and figured doing it would benefit ME! :-D</p>
<p dir="auto">Here’s how to accomplish the goal:</p>
<ul>
<li>Create TWO new Pythonscripts, one named <code>IncrSearchWindowPressFindNext.py</code> and one named <code>IncrSearchWindowPressFindPrev.py</code></li>
<li>Bind these Pythonscripts to TWO new keyboard shortcuts via the shortcut mapper (I use <code>Shift+Ctrl+.</code> for the “next” script and <code>Shift+Ctrl+,</code> for the “prev” script–these keystrokes are self-reminding as they are a variant of the <code>&lt;</code> and <code>&gt;</code> keys, the same as the text on the buttons in the Incremental Search window)</li>
</ul>
<p dir="auto">The TWO scripts should have the SAME contents and those contents are:</p>
<pre><code>import ctypes
from ctypes.wintypes import BOOL, HWND, LPARAM
from inspect import currentframe, getframeinfo

try:
    ISWPFNOP__incr_search_hwnd
except NameError:
    ISWPFNOP__incr_search_hwnd = None

def ISWPFNOP__main():  # (I)ncremental(S)earch(W)indow(P)ress(F)ind(N)ext(O)r(P)revious

    user32 = ctypes.windll.user32
    SendMessage = user32.SendMessageW
    FindWindow = user32.FindWindowW
    FindWindowEx = user32.FindWindowExW
    GetWindowText = user32.GetWindowTextW
    GetWindowTextLength = user32.GetWindowTextLengthW
    EnumChildWindows = user32.EnumChildWindows
    GetParent = user32.GetParent
    GetClassName = user32.GetClassNameW
    WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND,LPARAM)
    create_ub256 = ctypes.create_unicode_buffer(256)
    BM_CLICK = 0x00F5

    if ISWPFNOP__incr_search_hwnd == None:

        # the goal with this section is to locate the Incremental Search window

        # this is technically overkill but it DOES define the Incremental Search window:
        incr_search_classname_and_text_seq_list = [
            u'#32770', u'',
            u'Button', u'X',
            u'Static', u'Find :',
            u'Edit',   None,          # 'None' here means the text of control is variable
            u'Button', u'&lt;',
            u'Button', u'&gt;',
            u'Button', u'&amp;Highlight all',
            u'Button', u'Match &amp;case',
            u'Static', None,          # 'None' here means the text of control is variable
            ]

        ISWPFNOP__main.seq_list_index = 0

        def child_window_enumeration_function(hwnd, _):
            class_name = create_ub256[:GetClassName(hwnd, create_ub256, 256)]
            if (ISWPFNOP__main.seq_list_index % 2) == 0 and \
                    class_name == incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index]:
                ISWPFNOP__main.seq_list_index += 1
            advance_seq_index = False
            if (ISWPFNOP__main.seq_list_index % 2) == 1:
                text_length = GetWindowTextLength(hwnd)
                if text_length == 0:
                    if incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == u'' or \
                            incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == None:
                        advance_seq_index = True
                else:
                    buff = ctypes.create_unicode_buffer(text_length + 1)
                    GetWindowText(hwnd, buff, text_length + 1)
                    if incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == buff.value or \
                            incr_search_classname_and_text_seq_list[ISWPFNOP__main.seq_list_index] == None:
                        advance_seq_index = True
            if advance_seq_index:
                ISWPFNOP__main.seq_list_index += 1
            else:
                ISWPFNOP__main.seq_list_index = 0
            continue_with_the_enumeration = True
            if ISWPFNOP__main.seq_list_index == len(incr_search_classname_and_text_seq_list):
                # we surely found the Incremental-Search window! (it is the parent of the current child)
                global ISWPFNOP__incr_search_hwnd; ISWPFNOP__incr_search_hwnd = GetParent(hwnd)
                continue_with_the_enumeration = False
            return continue_with_the_enumeration

        EnumChildWindows(FindWindow(u'Notepad++', None), WNDENUMPROC(child_window_enumeration_function), 0)

    if ISWPFNOP__incr_search_hwnd != None:

        # save current view and doc index (and do it so that restoring later works well if a doc is cloned)
        saved_view = notepad.getCurrentView()
        saved_document_index = notepad.getCurrentDocIndex(saved_view)

        # find out which python file we are so we can determine which button to press:
        currently_running_pythonscript = getframeinfo(currentframe()).filename
        caption_of_button_to_press = '&gt;' if 'FindNext' in currently_running_pythonscript else '&lt;'

        # FINALLY, press the desired button:
        next_or_prev_button_hwnd = FindWindowEx(ISWPFNOP__incr_search_hwnd, 0, u'Button', caption_of_button_to_press)
        SendMessage(next_or_prev_button_hwnd, BM_CLICK, 0, 0)

        # return input focus to editor tab (focus was with incr search window):
        notepad.activateIndex(saved_view, saved_document_index)

ISWPFNOP__main()
</code></pre>
<p dir="auto">If this (or <em>ANY</em> posting on the <strong>Notepad++ Community</strong> site) is useful, don’t reply with a <em>“thanks”</em>, simply <strong>up-vote</strong> ( click the <code>^</code> in the <code>^ 0 v</code> area on the right ).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26254</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26254</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 15 Aug 2017 15:39:49 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Sat, 05 Aug 2017 11:14:08 GMT]]></title><description><![CDATA[<p dir="auto">Ah, thanks, didn’t come across that when I searched.</p>
<p dir="auto">The reason I close it is because it is just a single keystroke, Esc, whereas leaving it open would require me to use the mouse to switch focus back to the file itself – unless there is a keyboard shortcut for swapping focus? I like to do as much as possible with just the keyboard, swapping back and forth between mouse and keyboard is very cumbersome for me.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26135</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26135</guid><dc:creator><![CDATA[Andrew]]></dc:creator><pubDate>Sat, 05 Aug 2017 11:14:08 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboard shortcut for next&#x2F;previous incremental search result? on Sat, 05 Aug 2017 01:14:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/4840">@Andrew</a></p>
<p dir="auto">This has been an open issue since May 2016; see <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/1845" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/1845</a></p>
<p dir="auto">Oddly enough, I remember that issue was there since I added a comment to it earlier today.  :-D</p>
<p dir="auto">As a side note, why would you close the incremental-search window, only to have to reopen it?  That sounds like two unnecessary steps to me.  I always just leave it open; it is not that large that it takes up too much real estate…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/26127</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/26127</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 05 Aug 2017 01:14:22 GMT</pubDate></item></channel></rss>