Attempt at customizing the standard Explorer Folder Treeview
Apr 9, 2023 9:43:04 GMT -8
Post by waldemar21214 on Apr 9, 2023 9:43:04 GMT -8
Hey!
The classic 2000 explorer treeview goes a long way in improving the look of your explorer setup. I wanted to see if it would be possible to achieve it using a Windhawk mod. I got mixed results, the appearance is closer to that of 2000 but not quite there yet, and it has a big problem.The +-buttons do not display (literally nothing changes when the flag is set), and the lines (of all things) cause the item icons to be partially obstructed, somehow. I've peeked all around the explorer windows (to the best of my abilities) using WinSpy and x64dbg. I suspect that the treeview has a MFC wrapper simmilar to that of ReactOS explorer, and it has it's subclassed, and it has some custom drawing functions. I tried hooking into DefSubclassProc for the SysTreeview32 parent and intercept notifications for NM_CUSTOMDRAW, and returning CDRF_DODEFAULT but it doesn't change anything. I also tried removing the imagesets, but it only manages to hide the icons (as if they weren't obstructed enough already). Nothing I tried seems to fix it. Changing OpenShell explorer settings (or disabling it altogether) doesn't help either, at least for me.
The item size is set to 6, and WM_CAPTION is added to sort of emulate the "Folders" thingy on top of the treeview. This is done in a ShowWindow hook.
DefSubclassProcHook:
using DefSubclassProc_t = decltype(&DefSubclassProc);
DefSubclassProc_t pOriginalDefSubclassProc;
LRESULT WINAPI DefSubclassProcHook(HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam)
{
if(hWnd == NULL)
{
return 0;
}
//Wh_Log(L"kurwa mac");
wchar_t bufr[256];
GetClassName(hWnd, bufr, 256);
if (lstrcmpW(bufr, L"NamespaceTreeControl") == 0)
{
if(uMsg == WM_NOTIFY && ((LPNMHDR)lParam)->code == NM_CUSTOMDRAW)
{
return CDRF_DODEFAULT;
}
}
return pOriginalDefSubclassProc(hWnd, uMsg, wParam, lParam);
}