<?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[Setting to close Find window after initiating search?]]></title><description><![CDATA[<p dir="auto">When I want to search, I press CTRL+F and enter some text then click the Find Next button to begin the search.  The search dialog stays open.   Is there any setting to close that window when the search begins.  I usually just use F3 after the initial search to find additional occurrences.</p>
<p dir="auto">I realize there are other posts here for people who want to keep it open while searching, but I was just wondering if by chance there was an option to control this behavior.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19844/setting-to-close-find-window-after-initiating-search</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 19:11:01 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19844.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Aug 2020 18:20:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Tue, 21 Nov 2023 19:20:34 GMT]]></title><description><![CDATA[<p dir="auto">The desired behavior can be scripted if one wants to use a plugin (PythonScript) to achieve the goal.</p>
<p dir="auto">I call the script <code>FindNextClosesFindWindow.py</code> and here is its listing:</p>
<pre><code class="language-py"># -*- coding: utf-8 -*-
from __future__ import print_function

# see https://community.notepad-plus-plus.org/topic/19844/setting-to-close-find-window-after-initiating-search

from Npp import *
import platform
from ctypes import (WinDLL, WINFUNCTYPE)
from ctypes.wintypes import (HWND, UINT, INT, WPARAM, LPARAM)

#-------------------------------------------------------------------------------

user32 = WinDLL('user32')

GWL_WNDPROC = -4  # used to set a new address for the window procedure

LRESULT = LPARAM

WndProcType = WINFUNCTYPE(
    LRESULT,                    # return type
    HWND, UINT, WPARAM, LPARAM  # function arguments
    )

running_32bit = platform.architecture()[0] == '32bit'

SetWindowLong = user32.SetWindowLongW if running_32bit else user32.SetWindowLongPtrW
SetWindowLong.restype = WndProcType
SetWindowLong.argtypes = [ HWND, INT, WndProcType ]

SendMessageW = user32.SendMessageW
SendMessageW.restype = LRESULT
SendMessageW.argtypes = [ HWND, UINT, WPARAM, LPARAM ]

WM_COMMAND = 0x111
WM_CLOSE = 0x10

IDOK = 1  # 'Find Next' button in Find dialog
# for the following see https://github.com/notepad-plus-plus/notepad-plus-plus/blob/3c9d58176b0fd890d26e96d0208d2d981f1544e4/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h#L1
IDC_FINDNEXT = 1723  # 'Find down-arrow' button in Find dialog
IDC_FINDPREV = 1721  # 'Find up-arrow' button in Find dialog

#-------------------------------------------------------------------------------

class FNCFW(object):

    def __init__(self):
        for try_count in (1, 2):
            if try_count == 2: notepad.menuCommand(MENUCOMMAND.SEARCH_FIND)
            for find_window_tab_caption in [ u'Find', u'Replace', u'Find in Files', u'Find in Projects', u'Mark' ]:
                self.find_window_hwnd = user32.FindWindowExW(None, None, u'#32770', find_window_tab_caption)
                if self.find_window_hwnd:
                    self.new_find_wnd_proc_hook_for_SetWindowLong = WndProcType(self.new_find_wnd_proc_hook)
                    self.orig_find_wnd_proc = SetWindowLong(self.find_window_hwnd, GWL_WNDPROC, self.new_find_wnd_proc_hook_for_SetWindowLong)
                    if try_count == 2: self.close_find_window()
                    return

    def new_find_wnd_proc_hook(self, hwnd, msg, wParam, lParam):
        orig_wnd_proc_ret_val = self.orig_find_wnd_proc(hwnd, msg, wParam, lParam)
        if msg == WM_COMMAND and wParam in [ IDC_FINDNEXT, IDC_FINDPREV, IDOK ]: self.close_find_window()
        return orig_wnd_proc_ret_val

    def close_find_window(self): SendMessageW(self.find_window_hwnd, WM_CLOSE, 0, 0)

#-------------------------------------------------------------------------------

if __name__ == '__main__':
    try:
        fncfw
    except NameError:
        fncfw = FNCFW()
</code></pre>
<p dir="auto">It can be set up in <a href="http://startup.py" rel="nofollow ugc">startup.py</a> to run automatically when Notepad++ starts via these two lines:</p>
<pre><code class="language-py">import FindNextClosesFindWindow
fncfw = FindNextClosesFindWindow.FNCFW()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/90667</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90667</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 21 Nov 2023 19:20:34 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Tue, 21 Nov 2023 12:33:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sanderbouwhuis" aria-label="Profile: SanderBouwhuis">@<bdi>SanderBouwhuis</bdi></a></p>
<p dir="auto">The large <em>Find</em> window IS annoying on a single monitor setup (presume that is what yours is).  On multiple monitors, it isn’t so bad, you can have Notepad++ maximized on one monitor and put the find window on the/an adjacent monitor.</p>
<p dir="auto">Have you tried the “reduced size” <em>Find</em> window?  It looks like this:</p>
<p dir="auto"><img src="/assets/uploads/files/1700568296010-26c8d1e0-bb0e-4827-a1cd-209d5330a65b-image.png" alt="26c8d1e0-bb0e-4827-a1cd-209d5330a65b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">and the size is toggled by the button I’ve highlighted in yellow; same relative location for the button in the larger version of the window, but it has a <code>^</code> caption in that case.</p>
<hr />
<p dir="auto">Another interesting idea would be if the <em>Find</em> window would go “roving” after each match is found…if it needs to.  What this means is, if the text of the match found appears <em>under</em> the <em>Find</em> window, the window should reposition itself somewhere else, allowing you to see your matched text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90646</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90646</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 21 Nov 2023 12:33:16 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Tue, 21 Nov 2023 10:28:05 GMT]]></title><description><![CDATA[<p dir="auto">I too am really annoyed by this. I use the keyboard when using Notepad because it is a text editor. Everytime I do a search I get a popup window which doesn’t automatically close after I press the ENTER/RETURN key.<br />
This should be very easy to implement right? A simple setting which auto closes the popup window which is obscuring the text you are editing.<br />
I’m aware I can press the ESC key to close the window, but it happening automatically would greatly improve the fluidity of using Notepad.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/90642</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/90642</guid><dc:creator><![CDATA[SanderBouwhuis]]></dc:creator><pubDate>Tue, 21 Nov 2023 10:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Wed, 12 Aug 2020 18:28:01 GMT]]></title><description><![CDATA[<p dir="auto">That’s neat – Although it’s not always the case for my search term, I might be able to get used to that in those cases.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/56776</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/56776</guid><dc:creator><![CDATA[Vinnie M]]></dc:creator><pubDate>Wed, 12 Aug 2020 18:28:01 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Wed, 12 Aug 2020 15:22:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vinnie-m" aria-label="Profile: Vinnie-M">@<bdi>Vinnie-M</bdi></a></p>
<p dir="auto">If your search term is the word at the caret or some small bit of text that you could select first, you can avoid the _Find window entirely by executing <em>Select and Find Next</em>, which by default is Ctrl+F3.  Just a thought.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/56763</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/56763</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 12 Aug 2020 15:22:43 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Wed, 12 Aug 2020 15:18:32 GMT]]></title><description><![CDATA[<p dir="auto">I just don’t need it at that point since I always do F3 after the initial entry of the search text.  For me it’s just an unnecessary extra keystroke to remove it after starting the search.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/56761</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/56761</guid><dc:creator><![CDATA[Vinnie M]]></dc:creator><pubDate>Wed, 12 Aug 2020 15:18:32 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Wed, 12 Aug 2020 11:37:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vinnie-m" aria-label="Profile: Vinnie-M">@<bdi>Vinnie-M</bdi></a></p>
<p dir="auto">Probably the desire for this is that the <em>Find</em> window takes up a huge amount of space?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/56756</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/56756</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 12 Aug 2020 11:37:27 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Wed, 12 Aug 2020 04:28:20 GMT]]></title><description><![CDATA[<p dir="auto">Ok, thanks.  I was hoping for an option to close it after the initial Find Next button was clicked.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/56746</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/56746</guid><dc:creator><![CDATA[Vinnie M]]></dc:creator><pubDate>Wed, 12 Aug 2020 04:28:20 GMT</pubDate></item><item><title><![CDATA[Reply to Setting to close Find window after initiating search? on Tue, 11 Aug 2020 19:55:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vinnie-m" aria-label="Profile: Vinnie-M">@<bdi>Vinnie-M</bdi></a></p>
<p dir="auto">Probably the quickest way is to press <code>Esc</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/56744</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/56744</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 11 Aug 2020 19:55:33 GMT</pubDate></item></channel></rss>