Skip to content

Commit

Permalink
deploy: 283efe7
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 5, 2024
1 parent 3b45d25 commit e4e557d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 37 deletions.
4 changes: 2 additions & 2 deletions catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@
"published": 1699159361000,
"rating": 10,
"ratingUsers": 1,
"updated": 1699159361000,
"updated": 1730806745000,
"users": 124
},
"metadata": {
Expand All @@ -781,7 +781,7 @@
"explorer.exe"
],
"name": "Custom Shutdown Dialog",
"version": "1.0.0"
"version": "1.0.1"
}
},
"desktop-icons-view": {
Expand Down
5 changes: 5 additions & 0 deletions changelogs/custom-shutdown-dialog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.1 ([Nov 5, 2024](https://github.com/ramensoftware/windhawk-mods/blob/283efe79823953bacbe87532d0ade644bcbd8f62/mods/custom-shutdown-dialog.wh.cpp))

- Remove unnecessary version check, as it caused issues on older Explorer versions
- Refactor code to fit modern Windhawk standards

## 1.0.0 ([Nov 5, 2023](https://github.com/ramensoftware/windhawk-mods/blob/12155847ff2b01c1e5ec16e997b6f2189115cb35/mods/custom-shutdown-dialog.wh.cpp))

Initial release.
39 changes: 18 additions & 21 deletions mods/custom-shutdown-dialog.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @id custom-shutdown-dialog
// @name Custom Shutdown Dialog
// @description Override the classic shutdown dialog in Explorer with your own
// @version 1.0.0
// @version 1.0.1
// @author aubymori
// @github https://github.com/aubymori
// @include explorer.exe
Expand All @@ -14,8 +14,6 @@
# Custom Shutdown Dialog
Override the classic shutdown dialog in Explorer
which is invoked with `ALT`+`F4` with your own program.
**This mod will only work on Windows 10 or greater and Windhawk v1.4 or greater.**
*/
// ==/WindhawkModReadme==

Expand All @@ -31,12 +29,10 @@ which is invoked with `ALT`+`F4` with your own program.
// ==/WindhawkModSettings==

#include <windhawk_utils.h>
#include <versionhelpers.h>

WindhawkUtils::StringSetting g_szExe, g_szArgs;

typedef __int64 (* _ShutdownDialogEx_t)(HWND, int, int, UINT);
_ShutdownDialogEx_t _ShutdownDialogEx_orig;
__int64 (*_ShutdownDialogEx_orig)(HWND, int, int, UINT);
__int64 _ShutdownDialogEx_hook(
HWND hWndParent,
int i1,
Expand All @@ -55,6 +51,17 @@ __int64 _ShutdownDialogEx_hook(
return 0;
}

WindhawkUtils::SYMBOL_HOOK shutdownuxDllHooks[] = {
{
{
L"static _ShutdownDialogEx()"
},
&_ShutdownDialogEx_orig,
_ShutdownDialogEx_hook,
false
}
};

void LoadSettings(void)
{
g_szExe = WindhawkUtils::StringSetting::make(L"exe");
Expand All @@ -63,12 +70,6 @@ void LoadSettings(void)

BOOL Wh_ModInit(void)
{
if (!IsWindows10OrGreater())
{
Wh_Log(L"This mod was designed for Windows 10 and up.");
return FALSE;
}

LoadSettings();

HMODULE hShutdownUx = LoadLibraryW(L"shutdownux.dll");
Expand All @@ -78,15 +79,11 @@ BOOL Wh_ModInit(void)
return FALSE;
}

WindhawkUtils::SYMBOL_HOOK hook = {
{
L"static _ShutdownDialogEx()"
},
&_ShutdownDialogEx_orig,
_ShutdownDialogEx_hook
};

if (!HookSymbols(hShutdownUx, &hook, 1))
if (!WindhawkUtils::HookSymbols(
hShutdownUx,
shutdownuxDllHooks,
ARRAYSIZE(shutdownuxDllHooks)
))
{
Wh_Log(L"Failed to hook _ShutdownDialogEx");
return FALSE;
Expand Down
29 changes: 15 additions & 14 deletions updates.atom
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://windhawk.net/</id>
<title>Windhawk Mod Updates</title>
<updated>2024-11-03T01:03:06.000Z</updated>
<updated>2024-11-05T11:39: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[Custom Shutdown Dialog 1.0.1]]></title>
<id>https://windhawk.net/mods/custom-shutdown-dialog#283efe79823953bacbe87532d0ade644bcbd8f62</id>
<link href="https://windhawk.net/mods/custom-shutdown-dialog"/>
<updated>2024-11-05T11:39:05.000Z</updated>
<content type="html"><![CDATA[<ul>
<li>Remove unnecessary version check, as it caused issues on older Explorer versions</li>
<li>Refactor code to fit modern Windhawk standards</li>
</ul>]]></content>
<author>
<name>aubymori</name>
<uri>https://github.com/aubymori</uri>
</author>
</entry>
<entry>
<title type="html"><![CDATA[Taskbar auto-hide when maximized 1.1.1]]></title>
<id>https://windhawk.net/mods/taskbar-auto-hide-when-maximized#1819258d37a06f57310f9ab3c9f6538d808317f4</id>
Expand Down Expand Up @@ -277,19 +291,6 @@ there are no new notifications), and the "Show desktop" button.</p>
<li>Added themes: RosePine, Windows11_Metro10Minimal.</li>
<li>Updated existing themes.</li>
<li>Added a workaround for hanging the start menu process on Windows 10. Although the available themes and example styles are designed for Windows 11, it should now be possible to use the mod on Windows 10 too.</li>
</ul>]]></content>
<author>
<name>m417z</name>
<uri>https://github.com/m417z</uri>
</author>
</entry>
<entry>
<title type="html"><![CDATA[Windows 11 Notification Center Styler 1.1.4]]></title>
<id>https://windhawk.net/mods/windows-11-notification-center-styler#6f54b0820eb9261a690c18fc396760e82890975b</id>
<link href="https://windhawk.net/mods/windows-11-notification-center-styler"/>
<updated>2024-10-26T11:03:47.000Z</updated>
<content type="html"><![CDATA[<ul>
<li>Updated the TranslucentShell theme to make the text more readable when on a light background.</li>
</ul>]]></content>
<author>
<name>m417z</name>
Expand Down

0 comments on commit e4e557d

Please sign in to comment.