You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When set to dark mode, the call to NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR gives incorrect color at init plug-in. I'm trying to find a way to detect if Notepad++ is or is not running in dark mode, in order to set the correct color scheme for my plug-in.
Notepad++ initialises the plug-in using the call to the Dll Export setInfo. When I use the api call NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR at this moment the plug-in is initializing, then it always returns 16777215 (white) even when it's set to dark mode, so afaik that is incorrect. When I run the same api call later, after Notepad++ has started and is up and running, then it returns 4144959 (dark grey) which is correct.
Here's my code (it's C# btw)
var test123 = (int)Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR, 0, 0);
if (test123 <= 4210752) // #404040 dark grey roughly
{
// dark mode
}
else
{
// not dark mode
};
Am I using this api incorrectly? Or is it not returning the correct value at start-up?
Is there a way around this, or should I use a different api call to detect dark-mode?
Steps to Reproduce the Issue
set Notepad++ to dark mode and close
plug-in uses setInfo implementation
setInfo calls some plug-in initialization function
the initialization function calls NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR
get the return value
Expected Behavior
For dark mode the return value should be 0x3F3F3F (4144959 = dark grey)
Actual Behavior
Return value is 0xFFFFFF (16777215 = white)
Debug Information
Notepad++ v8.1.9 (32-bit)
Build time : Oct 21 2021 - 23:32:04
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 2009
OS Build : 19042.1288
Current ANSI codepage : 1252
Plugins : ComparePlugin.dll CSVLint.dll mimeTools.dll NppConverter.dll NppExport.dll NppXmlTreeviewPlugin.dll RandomValuesNppPlugin.dll XMLTools.dll
The text was updated successfully, but these errors were encountered:
Description of the Issue
When set to dark mode, the call to NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR gives incorrect color at init plug-in. I'm trying to find a way to detect if Notepad++ is or is not running in dark mode, in order to set the correct color scheme for my plug-in.
Notepad++ initialises the plug-in using the call to the Dll Export
setInfo
. When I use the api call NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR at this moment the plug-in is initializing, then it always returns 16777215 (white) even when it's set to dark mode, so afaik that is incorrect. When I run the same api call later, after Notepad++ has started and is up and running, then it returns 4144959 (dark grey) which is correct.Here's my code (it's C# btw)
Am I using this api incorrectly? Or is it not returning the correct value at start-up?
Is there a way around this, or should I use a different api call to detect dark-mode?
Steps to Reproduce the Issue
setInfo
implementationsetInfo
calls some plug-in initialization functionNPPM_GETEDITORDEFAULTBACKGROUNDCOLOR
Expected Behavior
For dark mode the return value should be 0x3F3F3F (4144959 = dark grey)
Actual Behavior
Return value is 0xFFFFFF (16777215 = white)
Debug Information
Notepad++ v8.1.9 (32-bit)
Build time : Oct 21 2021 - 23:32:04
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Home (64-bit)
OS Version : 2009
OS Build : 19042.1288
Current ANSI codepage : 1252
Plugins : ComparePlugin.dll CSVLint.dll mimeTools.dll NppConverter.dll NppExport.dll NppXmlTreeviewPlugin.dll RandomValuesNppPlugin.dll XMLTools.dll
The text was updated successfully, but these errors were encountered: