Open/Save Dialog ClientEdge
Oct 4, 2023 14:24:30 GMT -8
Post by aubymori on Oct 4, 2023 14:24:30 GMT -8
I've just made a mod to apply client edge to the legacy open/save dialog.
Preview:
Mod code:
// ==WindhawkMod==
// @id open-save-clientedge
// @name Open/Save Dialog ClientEdge
// @description Applies WS_EX_CLIENTEDGE to the list view in legacy open/save dialogs
// @version 1.0.0
// @author aubymori
// @github https://github.com/aubymori
// @twitter https://twitter.com/jack
// @homepage https://your-personal-homepage.example.com/
// @include *
// ==/WindhawkMod==
// ==WindhawkModReadme==
/*
# Open/Save Dialog ClientEdge
Applies WS_EX_CLIENTEDGE to the list view in legacy open/save dialogs.
*/
// ==/WindhawkModReadme==
using CreateWindowExW_t = decltype(&CreateWindowExW);
CreateWindowExW_t CreateWindowExW_orig;
HWND WINAPI CreateWindowExW_hook(
DWORD dwExStyle,
LPCWSTR lpClassName,
LPCWSTR lpWindowName,
DWORD dwStyle,
int X,
int Y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam
)
{
if (hWndParent != NULL
&& lpClassName != NULL
&& ((ULONG_PTR)lpClassName & ~(ULONG_PTR)0xffff) != 0
&& !wcscmp(lpClassName, L"SysListView32"))
{
WCHAR lpParCls[256];
GetClassNameW(hWndParent, lpParCls, 256);
if (!wcscmp(lpParCls, L"SHELLDLL_DefView"))
{
HWND hDlg = GetParent(hWndParent);
if (hDlg)
{
WCHAR lpDlgCls[256];
GetClassNameW(hDlg, lpDlgCls, 256);
if (!wcscmp(lpDlgCls, L"#32770"))
{
dwExStyle |= WS_EX_CLIENTEDGE;
}
}
}
}
return CreateWindowExW_orig(
dwExStyle,
lpClassName,
lpWindowName,
dwStyle,
X,
Y,
nWidth,
nHeight,
hWndParent,
hMenu,
hInstance,
lpParam
);
}
BOOL Wh_ModInit(void)
{
if (!Wh_SetFunctionHook(
(void *)CreateWindowExW,
(void *)CreateWindowExW_hook,
(void **)&CreateWindowExW_orig
))
{
Wh_Log(L"Failed to hook CreateWindowExW");
return FALSE;
}
return TRUE;
}