Skip to content

A common, shareable DLL for enabling the Darkmode feature in Notepad++ plugins

License

Notifications You must be signed in to change notification settings

shriprem/NPP_Plugin_Darkmode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Darkmode Libary for Notepad++ Plugins

GitHub GitHub release (latest by date) GitHub all releases

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.

NOTE: This release is compatible with Notepad++ 8.4.3 or later versions

Source File Usage:

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.

API Functions:

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);

API Usage Notes:

  1. Documentation for plugins written in C++. (This document will be updated shortly for the NPP_Plugin_Darkmode 2.0 version changes.)

Source Code Attributions:

Unchanged Notepad++ Source Files

  1. DarkMode.h
  2. DarkMode.cpp
  3. IatHook.h
  4. Notepad_plus_msgs.h

Adapted Notepad++ Source Files

  1. NppDarkMode.h
  2. NppDarkMode.cpp