Skip to content

Commit

Permalink
deploy: 32a08d9
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 6, 2024
1 parent 1fd7fe2 commit 2ce4a8c
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 14 deletions.
20 changes: 20 additions & 0 deletions catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,26 @@
"version": "1.1.1"
}
},
"dark-menus": {
"details": {
"defaultSorting": 0,
"published": 1733519825000,
"rating": 0,
"ratingUsers": 0,
"updated": 1733519825000,
"users": 0
},
"metadata": {
"author": "Mgg Sk",
"description": "Enables dark mode for all win32 menus.",
"github": "https://github.com/MGGSK",
"include": [
"*"
],
"name": "Dark mode context menus",
"version": "1.0"
}
},
"desktop-icons-view": {
"details": {
"defaultSorting": 460,
Expand Down
3 changes: 3 additions & 0 deletions changelogs/dark-menus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0 ([Dec 6, 2024](https://github.com/ramensoftware/windhawk-mods/blob/32a08d93bca7856d61c3bac57491c6a2ff7aaafa/mods/dark-menus.wh.cpp))

Initial release.
67 changes: 67 additions & 0 deletions mods/dark-menus.wh.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// ==WindhawkMod==
// @id dark-menus
// @name Dark mode context menus
// @description Enables dark mode for all win32 menus.
// @version 1.0
// @author Mgg Sk
// @github https://github.com/MGGSK
// @include *
// ==/WindhawkMod==

// ==WindhawkModReadme==
/*
# Dark mode context menus
Forces dark mode for all win32 context menus to create a more consistent UI.
### Before:
![Before](https://i.imgur.com/bGRVJz8.png)
### After:
![After](https://i.imgur.com/BURKEki.png)
*/
// ==/WindhawkModReadme==

#include <minwindef.h>
#include <winerror.h>

enum AppMode
{
Default,
AllowDark,
ForceDark,
ForceLight,
Max
};

using FlushMenuThemes_T = void (WINAPI *)();
using SetPreferredAppMode_T = HRESULT (WINAPI *)(AppMode appMode);

FlushMenuThemes_T FlushMenuThemes;
SetPreferredAppMode_T SetPreferredAppMode;

//Applies the theme to all menus.
HRESULT ApplyTheme()
{
FlushMenuThemes();
return SetPreferredAppMode(ForceDark);
}

//Import functions
BOOL Wh_ModInit() {
HMODULE hUxtheme = LoadLibraryExW(L"uxtheme.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
FARPROC pSetPreferredAppMode = GetProcAddress(hUxtheme, MAKEINTRESOURCEA(135));
FARPROC pFlushMenuThemes = GetProcAddress(hUxtheme, MAKEINTRESOURCEA(136));

SetPreferredAppMode = reinterpret_cast<SetPreferredAppMode_T>(pSetPreferredAppMode);
FlushMenuThemes = reinterpret_cast<FlushMenuThemes_T>(pFlushMenuThemes);

HRESULT hResult = ApplyTheme();
return SUCCEEDED(hResult);
}

//Restores the default theme.
void Wh_ModUninit()
{
FlushMenuThemes();
SetPreferredAppMode(Default);
}
31 changes: 17 additions & 14 deletions updates.atom
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://windhawk.net/</id>
<title>Windhawk Mod Updates</title>
<updated>2024-12-04T14:18:49.000Z</updated>
<updated>2024-12-06T21:17:05.000Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<link rel="alternate" href="https://windhawk.net/"/>
<subtitle>Updates in the official collection of Windhawk mods</subtitle>
<icon>https://windhawk.net/favicon.ico</icon>
<rights>Ramen Software</rights>
<entry>
<title type="html"><![CDATA[Dark mode context menus 1.0]]></title>
<id>https://windhawk.net/mods/dark-menus#32a08d93bca7856d61c3bac57491c6a2ff7aaafa</id>
<link href="https://windhawk.net/mods/dark-menus"/>
<updated>2024-12-06T21:17:05.000Z</updated>
<content type="html"><![CDATA[<h1 id="darkmodecontextmenus">Dark mode context menus</h1>
<p>Forces dark mode for all win32 context menus to create a more consistent UI.</p>
<h3 id="before">Before:</h3>
<p><img src="https://i.imgur.com/bGRVJz8.png" alt="Before" /></p>
<h3 id="after">After:</h3>
<p><img src="https://i.imgur.com/BURKEki.png" alt="After" /></p>]]></content>
<author>
<name>Mgg Sk</name>
<uri>https://github.com/MGGSK</uri>
</author>
</entry>
<entry>
<title type="html"><![CDATA[Better file sizes in Explorer details 1.4.5]]></title>
<id>https://windhawk.net/mods/explorer-details-better-file-sizes#1c07c82111a8cfb4c2a1757f702e598172570193</id>
Expand Down Expand Up @@ -291,17 +307,4 @@ center, etc. to another monitor.</p>
<uri>https://github.com/aubymori</uri>
</author>
</entry>
<entry>
<title type="html"><![CDATA[Better file sizes in Explorer details 1.4.4]]></title>
<id>https://windhawk.net/mods/explorer-details-better-file-sizes#f396f78d645dc57089bf4805a63b0bd82f50d745</id>
<link href="https://windhawk.net/mods/explorer-details-better-file-sizes"/>
<updated>2024-11-10T12:57:54.000Z</updated>
<content type="html"><![CDATA[<ul>
<li>Fixed the "Mix files and folders when sorting by size" option that stopped working in version 1.4.2.</li>
</ul>]]></content>
<author>
<name>m417z</name>
<uri>https://github.com/m417z</uri>
</author>
</entry>
</feed>

0 comments on commit 2ce4a8c

Please sign in to comment.