API Library for enabling the Darkmode feature in any Notepad++ plugin written in C++.
This API library was initially developed for use with the FWDataViz and GotoLineCol plugins.
The documentation here is primarily meant for Notepad++ plugins written in C++.
A significant portion of the code in this repo has been either imported as is or adapted from files in the Notepad++ repository. For more information, see: Source Code Attributions.
This API Library can be utilized by importing all the 8 files found in the folder path src/Darkmode/
of this repo into your plugin solution, and then adding #include "<relative_Darkmode_folder_path>/NPP_Plugin_Darkmode.h"
in all your DialogXYZ.cpp files.
void NPPDM_InitDarkMode(const HWND _nppHandle);
void NPPDM_QueryNPPDarkmode();
bool NPPDM_IsEnabled();
void NPPDM_AutoSubclassAndThemeChildControls(HWND hwndParent);
void NPPDM_AutoThemeChildControls(HWND hwndParent);
void NPPDM_SetDarkTitleBar(HWND hwnd);
void NPPDM_InitSysLink(HWND hCtl);
LRESULT NPPDM_OnCtlColor(HDC hdc);
LRESULT NPPDM_OnCtlColorSofter(HDC hdc);
LRESULT NPPDM_OnCtlColorDarker(HDC hdc);
LRESULT NPPDM_OnCtlColorError(HDC hdc);
LRESULT NPPDM_OnCtlColorSysLink(HDC hdc);
LRESULT NPPDM_OnCtlColorIfEnabled(HDC hdc, bool isEnabled);
LRESULT NPPDM_OnCtlHiliteIfEnabled(HDC hdc, bool isEnabled);
INT_PTR NPPDM_OnCtlColorListbox(WPARAM wParam, LPARAM lParam);
- Documentation for plugins written in C++. (This document will be updated shortly for the NPP_Plugin_Darkmode 2.0 version changes.)
Unchanged Notepad++ Source Files
- DarkMode.h
- DarkMode.cpp
- IatHook.h
- Notepad_plus_msgs.h
Adapted Notepad++ Source Files
- NppDarkMode.h
- NppDarkMode.cpp