<?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[Bookmark line becomes unchecked on reopening application]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1644603357362-bookmark-line-issue.png" alt="Bookmark line issue.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Hello, I run searches on large text files at work. Whenever I need to bookmark my searches on lines of text, I naturally check the parameter Bookmark line. The problem? If I restart the application or if I install a Notepad++ update and restart the application, all my customized preferences, such as Backward direction, the font size, Wrap around, etc. are maintained, except Bookmark line, which appears unchecked.</p>
<p dir="auto">This is a bit annoying because I need it to be checked permanently so that I can copy the bookmarked lines on the searched text file.</p>
<p dir="auto">Any suggestions? Maybe it’s a bug. Thank you.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22552/bookmark-line-becomes-unchecked-on-reopening-application</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 02:15:04 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22552.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 11 Feb 2022 18:18:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bookmark line becomes unchecked on reopening application on Mon, 18 Dec 2023 11:34:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said in <a href="/post/74082">Bookmark line becomes unchecked on reopening application</a>:</p>
<blockquote>
<p dir="auto">not sure why this text seems to have a Alt+h keyboard accelerator as I don’t see how you can use it in Notepad++'s UI.</p>
</blockquote>
<p dir="auto">One more thing I’m not sure of:  Why I had said that.<br />
If a control in the <em>Incremental Search</em> window has input focus, e.g. the <em>Find</em> edit box, then Alt+h will focus and toggle the <em>Highlight all</em> checkbox setting.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91294</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91294</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 18 Dec 2023 11:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Bookmark line becomes unchecked on reopening application on Fri, 11 Feb 2022 21:52:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a> said in <a href="/post/74081">Bookmark line becomes unchecked on reopening application</a>:</p>
<blockquote>
<p dir="auto">if buff.value == u’&amp;Highlight all’:</p>
</blockquote>
<p dir="auto">Also not sure why this text seems to have a Alt+h keyboard accelerator as I don’t see how you can use it in Notepad++'s UI.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/74082</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/74082</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 11 Feb 2022 21:52:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bookmark line becomes unchecked on reopening application on Fri, 11 Feb 2022 21:50:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14847">@michael-vincent</a> said in <a href="/post/74080">Bookmark line becomes unchecked on reopening application</a>:</p>
<blockquote>
<p dir="auto">but it does not check the “Highlight all” checkbox.  Any pointers?</p>
</blockquote>
<p dir="auto">It’s all about having that control’s handle (hwnd).</p>
<p dir="auto">Cobbling some code together by stealing a lot from <a href="https://community.notepad-plus-plus.org/topic/13754">THIS THREAD</a>, I came up with this:</p>
<pre><code># -*- coding: utf-8 -*-
from __future__ import print_function

import ctypes
from ctypes.wintypes import BOOL, HWND, LPARAM

WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM)

FindWindow = ctypes.windll.user32.FindWindowW
SendMessage = ctypes.windll.user32.SendMessageW
EnumChildWindows = ctypes.windll.user32.EnumChildWindows
GetClassName = ctypes.windll.user32.GetClassNameW
GetWindowText = ctypes.windll.user32.GetWindowTextW
GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW
create_unicode_buffer = ctypes.create_unicode_buffer

curr_class = create_unicode_buffer(256)

BM_SETCHECK = 0x00F1
BST_CHECKED = 1

incr_search_highlight_all_hwnd = [ 0 ]

def EnumCallback(hwnd, _):
    GetClassName(hwnd, curr_class, 256)
    length = GetWindowTextLength(hwnd)
    if length:
        buff = create_unicode_buffer(length + 1)
        GetWindowText(hwnd, buff, length + 1)
        print('class:', curr_class.value, '|', 'text:', buff.value)
        if buff.value == u'&amp;Highlight all':
            incr_search_highlight_all_hwnd[0] = hwnd
    else:
        print('class:', curr_class.value)
    return True  # let enumeration continue

notepad.menuCommand(MENUCOMMAND.SEARCH_FINDINCREMENT)
notepad_hwnd = ctypes.windll.user32.FindWindowW(u'Notepad++', None)
if notepad_hwnd:
    EnumChildWindows(notepad_hwnd, WNDENUMPROC(EnumCallback), 0)
    if incr_search_highlight_all_hwnd[0]:
        SendMessage(incr_search_highlight_all_hwnd[0], BM_SETCHECK, BST_CHECKED, 0)
</code></pre>
<p dir="auto">It’s instructive to look at the PythonScript console as it runs – although for me it seems to write to the console very slowly and I don’t know why this is…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/74081</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/74081</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 11 Feb 2022 21:50:01 GMT</pubDate></item><item><title><![CDATA[Reply to Bookmark line becomes unchecked on reopening application on Fri, 11 Feb 2022 20:53:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@alan-kilborn</a> said in <a href="/post/74071">Bookmark line becomes unchecked on reopening application</a>:</p>
<blockquote>
<p dir="auto">If you’re willing to use the PythonScript plugin, I have a solution in the form of…a script!</p>
</blockquote>
<p dir="auto">I’m willing - but I don’t want that use case.  I want to check the “Highlight all” in the Search =&gt; Incremental Search “window”.</p>
<p dir="auto">I modified your script, but having some issues.  The Incremental Search windows is “attached” to Notepad++ so I don’t see a new Windows class name (<code>#32770</code> like for the “Mark” pop-up).  Also, for the Window title - “Mark” works nicely for the Mark window popup - what do I use for the Incremental Search “window” which is “attached” to Notepad++ - the Notepad++ “title” I have changes based on the open filename.  I think i got the other stuff done:</p>
<ul>
<li>replace <code>IDC_MARKLINE_CHECK</code> with <code>IDC_INCFINDHILITEALL</code> (1690, from ScintillaComponent/FindReplaceDlg_rc.h)</li>
<li><code>MENUCOMMAND.SEARCH_MARK</code> replaced with <code>MENUCOMMAND.SEARCH_FINDINCREMENT</code></li>
</ul>
<p dir="auto">So my script does open the Incremental Search “window”, but it does not check the “Highlight all” checkbox.  Any pointers?</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/74080</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/74080</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Fri, 11 Feb 2022 20:53:42 GMT</pubDate></item><item><title><![CDATA[Reply to Bookmark line becomes unchecked on reopening application on Sat, 12 Feb 2022 17:37:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/24486">@mario-chávez</a></p>
<p dir="auto">If you’re willing to use the PythonScript plugin, I have a solution in the form of…a script!</p>
<p dir="auto">I call the script <code>BookmarkLineCheckboxTick.py</code> and it looks like this:</p>
<pre><code># -*- coding: utf-8 -*-
from __future__ import print_function

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

from Npp import *
import inspect
import os
import ctypes
from ctypes import wintypes

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

user32 = ctypes.WinDLL('user32')

LRESULT = wintypes.LPARAM

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

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

IDC_MARKLINE_CHECK = 1616
BM_SETCHECK = 0x00F1
BST_CHECKED = 1

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

class BLCT(object):

    def __init__(self):
        notepad.menuCommand(MENUCOMMAND.SEARCH_MARK)
        find_dlg_hwnd = user32.FindWindowExW(None, None, u'#32770', u'Mark')
        bookmark_checkbox_hwnd = user32.GetDlgItem(find_dlg_hwnd, IDC_MARKLINE_CHECK)
        SendMessageW(bookmark_checkbox_hwnd, BM_SETCHECK, BST_CHECKED, 0)

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

if __name__ == '__main__': BLCT()
</code></pre>
<p dir="auto">It can be set to run at Notepad++ startup by setting the scripting plugin’s <em>Initialisation</em> parameter to <code>ATSTARTUP</code> and then putting the following lines into the <code>startup (User)</code> script:</p>
<pre><code>import BookmarkLineCheckboxTick
BookmarkLineCheckboxTick.BLCT()
</code></pre>
<p dir="auto">The result of this will be that the <em>Bookmark line</em> checkbox will always be ticked when Notepad++ starts.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/74071</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/74071</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 12 Feb 2022 17:37:46 GMT</pubDate></item><item><title><![CDATA[Reply to Bookmark line becomes unchecked on reopening application on Fri, 11 Feb 2022 18:30:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/24486">@mario-chávez</a> said in <a href="/post/74067">Bookmark line becomes unchecked on reopening application</a>:</p>
<blockquote>
<p dir="auto">Maybe it’s a bug.</p>
</blockquote>
<p dir="auto">It’s not a bug. It’s just not a feature I’ve heard of anyone asking for, and maybe not one that the developers have thought of to implement.  If you would like Notepad++ to remember the “Bookmark line” checkbox like it remembers the other checkboxes, you can follow the <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report">FAQ instructions for making a feature request</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/74069</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/74069</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 11 Feb 2022 18:30:17 GMT</pubDate></item></channel></rss>