<?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[Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode]]></title><description><![CDATA[<p dir="auto">Usage:<br />
<code>void NPPM_ADDTOOLBARICON_FORDARKMODE(UINT funcItem[X]._cmdID, toolbarIconsWithDarkMode iconHandles)</code></p>
<p dir="auto">This new API <code>NPPM_ADDTOOLBARICON_FORDARKMODE</code> is for replacing obsolete <code>NPPM_ADDTOOLBARICON</code> which doesn’t support the dark mode.<br />
2 formats / 3 icons are needed:  1 * BMP + 2 * ICO</p>
<p dir="auto">All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode.</p>
<pre><code>	struct toolbarIconsWithDarkMode {
		HBITMAP	hToolbarBmp;
		HICON	hToolbarIcon;
		HICON	hToolbarIconDarkMode;
	};
</code></pre>
<p dir="auto">You can find the demo here:<br />
<a href="https://github.com/npp-plugins/plugindemo" rel="nofollow ugc">https://github.com/npp-plugins/plugindemo</a></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21652/add-new-api-nppm_addtoolbaricon_fordarkmode-for-dark-mode</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 03:02:57 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21652.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Aug 2021 11:05:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Sun, 26 Dec 2021 01:01:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3">@donho</a><br />
Was just starting to implement darkmode icons…<br />
What happens with plugins used in older versions of NPP?<br />
I guess I’m not the only one facing this for some time.<br />
I would implement both messages and make the choice by the NPP version:</p>
<pre><code>         if (8 &lt;= HIWORD(execute(nppHandle, NPPM_GETNPPVERSION))) { // version 8 did introduce the dark mode
            g_TBIconsDrk.hToolbarBmp = (HBITMAP)::LoadImage(_findDlg.getHinst(), MAKEINTRESOURCE(IDB_TB_ANALYSE), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
            g_TBIconsDrk.hToolbarIcon = (HICON)::LoadIcon(_findDlg.getHinst(), MAKEINTRESOURCE(IDI_ANALYSE_NEW));
            g_TBIconsDrk.hToolbarIconDarkMode = (HICON)::LoadIcon(_findDlg.getHinst(), MAKEINTRESOURCE(IDI_ANALYSE_NEW_DRK));
            execute(nppHandle, NPPM_ADDTOOLBARICON_FORDARKMODE, (WPARAM)funcItem[SHOWFINDDLG]._cmdID, (LPARAM)&amp;g_TBIconsDrk);
         }
         else {
            g_TBIconsOld.hToolbarBmp = (HBITMAP)::LoadImage(_findDlg.getHinst(), MAKEINTRESOURCE(IDB_TB_ANALYSE), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_LOADMAP3DCOLORS));
            g_TBIconsOld.hToolbarIcon = (HICON)::LoadIcon(_findDlg.getHinst(), MAKEINTRESOURCE(IDI_ANALYSE));
            execute(nppHandle, NPPM_ADDTOOLBARICON_DEPRECATED, (WPARAM)funcItem[SHOWFINDDLG]._cmdID, (LPARAM)&amp;g_TBIconsOld);
         }
</code></pre>
<p dir="auto">This works with older versions also.<br />
Comments?<br />
rgds, Mattes</p>
]]></description><link>https://community.notepad-plus-plus.org/post/72368</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/72368</guid><dc:creator><![CDATA[mattesh]]></dc:creator><pubDate>Sun, 26 Dec 2021 01:01:02 GMT</pubDate></item><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Mon, 16 Aug 2021 00:46:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3">@donho</a> said in <a href="/post/68973">Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode</a>:</p>
<blockquote>
<p dir="auto">Your suggestion has been implemented and merged in master:</p>
</blockquote>
<p dir="auto">Using Fluent icons in non-dark mode with some non-fluent plugin icons and Customize Toolbar plugin - ALL WORKS!!!</p>
<p dir="auto"><img src="/assets/uploads/files/1629074750573-115c11d2-777e-42d5-a558-405cb27eb89c-image.png" alt="115c11d2-777e-42d5-a558-405cb27eb89c-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Great!</p>
<p dir="auto">Thank you!</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68976</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68976</guid><dc:creator><![CDATA[Michael Vincent]]></dc:creator><pubDate>Mon, 16 Aug 2021 00:46:03 GMT</pubDate></item><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Mon, 16 Aug 2021 00:25:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a> said in <a href="/post/68860">Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode</a>:</p>
<p dir="auto">Your suggestion has been implemented and merged in master:<br />
<a href="https://github.com/notepad-plus-plus/notepad-plus-plus/commit/302bab894fd421fde371e04247357bc45728d729" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/commit/302bab894fd421fde371e04247357bc45728d729</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/68973</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68973</guid><dc:creator><![CDATA[donho]]></dc:creator><pubDate>Mon, 16 Aug 2021 00:25:00 GMT</pubDate></item><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Sat, 14 Aug 2021 14:06:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a> said in <a href="/post/68860">Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode</a>:</p>
<blockquote>
<p dir="auto">I’m not suggesting modifying the struct, just to use the one icon in the struct in all cases to prevent missing icons.</p>
</blockquote>
<p dir="auto">I will see what I can do about it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68865</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68865</guid><dc:creator><![CDATA[donho]]></dc:creator><pubDate>Sat, 14 Aug 2021 14:06:37 GMT</pubDate></item><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Sat, 14 Aug 2021 12:09:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3">@donho</a> said in <a href="/post/68859">Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode</a>:</p>
<blockquote>
<p dir="auto">OTOH, there’s no way to extend  NPPM_ADDTOOLBARICON since the pointer of icons handles structure is passed as arguments.</p>
</blockquote>
<p dir="auto">I’m not suggesting modifying the struct, just to use the one icon in the struct in all cases to prevent missing icons.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68860</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68860</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Sat, 14 Aug 2021 12:09:51 GMT</pubDate></item><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Sat, 14 Aug 2021 11:53:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/34">@dail</a> said in <a href="/post/68811">Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode</a>:</p>
<blockquote>
<p dir="auto">Many existing plugins are still using this old message. This causes missing icons on the toolbar for plugins when Notepad++ is configured to use Fluent UI.<br />
I would suggest slightly modifying the behavior of NPPM_ADDTOOLBARICON so that it reuses the hToolbarIcon icon in place of the hToolbarIconDarkMode icon.<br />
This would at least allow a plugin to have ugly icons when using Fluent UI rather than icons that are completely missing.</p>
</blockquote>
<p dir="auto">Message <code>NPPM_ADDTOOLBARICON</code> works as usual in the newest version of Notepad++ for all plugins which use this message. It doesn’t support only dark mode.</p>
<p dir="auto">The new API <code>NPPM_ADDTOOLBARICON_FORDARKMODE</code> for dark mode is here for substituting <code>NPPM_ADDTOOLBARICON</code>, so the retro-compatibility is remained.</p>
<p dir="auto">OTOH, there’s no way to extend  <code>NPPM_ADDTOOLBARICON</code> since the pointer of icons handles structure is passed as arguments.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68859</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68859</guid><dc:creator><![CDATA[donho]]></dc:creator><pubDate>Sat, 14 Aug 2021 11:53:28 GMT</pubDate></item><item><title><![CDATA[Reply to Add new API NPPM_ADDTOOLBARICON_FORDARKMODE for dark mode on Fri, 13 Aug 2021 13:04:25 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3">@donho</a></p>
<p dir="auto">Since the <code>NPPM_ADDTOOLBARICON</code> message is being deprecated I do have a suggestion.</p>
<p dir="auto">Many existing plugins are still using this old message. This causes missing icons on the toolbar for plugins when Notepad++ is configured to use Fluent UI.</p>
<p dir="auto">I would suggest slightly modifying the behavior of <code>NPPM_ADDTOOLBARICON</code> so that it reuses the <code>hToolbarIcon</code> icon in place of the <code>hToolbarIconDarkMode</code> icon.</p>
<p dir="auto">This would at least allow a plugin to have ugly icons when using Fluent UI rather than icons that are completely missing.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/68811</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/68811</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Fri, 13 Aug 2021 13:04:25 GMT</pubDate></item></channel></rss>