|
Post by justaduckinacostume on Sept 22, 2024 11:41:41 GMT -8
I'm using 21H2 and ImSwordQueen's transformation pack and included theme, yet when I open explorer all I get is a blank page. This occurs when the included Aerexplorer fork mod is enabled, but without it enabled I do not get library headers.
|
|
⠀
Freshman Member
Posts: 79
OS: Windows 10 Enterprise LTSC 2019
|
Post by ⠀ on Sept 23, 2024 4:47:30 GMT -8
I'm using 21H2 and ImSwordQueen's transformation pack and included theme, yet when I open explorer all I get is a blank page. This occurs when the included Aerexplorer fork mod is enabled, but without it enabled I do not get library headers. you need to download the provided shellstyle.dll to the msstyles folder that you are using
|
|
|
Post by kwan on Sept 24, 2024 12:52:50 GMT -8
THIS MOD WASN'T MADE BY ME. THE ORIGINAL CREATOR WAS Ojask3804. I'M ONLY RELEASING HERE BECAUSE THE MOD GOT LEAKED AND IS BEING SHARED IN PRIVATE CIRCLES.!!!!!! THIS MOD ONLY WORKS PROPERLY ON 21H2to7 BY DEFAULT. For obvious reasons, Do not include this mod in custom ISOs/10to7 mods !!!!!!
!!! This mod is still being worked on by original creator. If possible please wait until he releases it (On his own accord and time) as a complete mod !!!!
Current issues: - Any buttons that were meant to appear in the headers do not exist. (They were planned for the rewritten version of the mod but the creator quit before that could happen.) - The mod could brick explorer if you do not use the pre-included shellstyle that is meant to replace the one in the theme folder. - The mod could not work on certain installs. It works 100% on my 21H2to7 Transformation Pack though.
Credits: Ojask3804 - Original Creator of the mod. Aubymori - For aerexplorer. if i put a folder named "pt-BR" with the shellstyle.dll.mui from that locale, would it load?
|
|
kosfurler
Sophomore Member
Posts: 105
OS: Windows 10 2H22
Theme: Windows 7
|
Post by kosfurler on Sept 24, 2024 13:26:00 GMT -8
RUSSIAN VERSION:
{Show code}
// ==WindhawkMod== // @id libraries-windows-7 // @name Minecraft Library mod // @description A folder is a container that helps you to organize your files. Every file on your computer is stored in a folder, and folders can also hold other folders. // @version 0.1 // @author Ojask3804 // @github https://github.com/nat // @twitter https://twitter.com/jack // @homepage https://your-personal-homepage.example.com/ // @include explorer.exe // @compilerOptions -lcomctl32 -luuid -lole32 // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Your Awesome Mod This mod is mostly made for 21H2to7 in mind and not any other mod. If you use reloaded7 then you are on your own. */ // ==/WindhawkModReadme==
// The source code of the mod starts here. This sample was inspired by the great // article of Kyle Halladay, X64 Function Hooking by Example: // http://kylehalladay.com/blog/2020/11/13/Hooking-By-Example.html // If you're new to terms such as code injection and function hooking, the // article is great to get started.
#include <exdisp.h> #include <minwindef.h> #include <shlobj.h> #include <shobjidl.h> #include <windhawk_api.h> #include <windhawk_utils.h> #include <windows.h> #include <string>
class Element;
struct IElementListener { public: virtual void OnListenerAttach(class Element* elem) = 0; virtual void OnListenerDetach(class Element* elem) = 0; virtual bool OnPropertyChanging(class Element* elem, const struct PropertyInfo* prop, int unk, class Value* before, class Value* after) = 0; virtual void OnListenedPropertyChanged(class Element* elem, const struct PropertyInfo* prop, int type, class Value* before, class Value* after) = 0; virtual void OnListenedInput(class Element* elem, struct InputEvent* event) = 0; virtual void OnListenedEvent(class Element* elem, struct Event* event) = 0; };
struct EventListener : public IElementListener { void (*f)(Element* elem, struct Event* ev); EventListener(void (*func)(Element* elem, struct Event* ev)) { f = func; } void OnListenerAttach(Element* elem) override {} void OnListenerDetach(Element* elem) override {} bool OnPropertyChanging(Element* elem, const PropertyInfo* prop, int unk, Value* v1, Value* v2) override { return true; } void OnListenedPropertyChanged(Element* elem, const PropertyInfo* prop, int type, Value* v1, Value* v2) override {} void OnListenedEvent(Element* elem, struct Event* iev) override { f(elem, iev); } void OnListenedInput(Element* elem, struct InputEvent* ev) override {} };
typedef int (*IsLibrary_t)(class IShellItem*); IsLibrary_t IsLibrary;
typedef int (*IsLibrariesFolder_t)(class IShellItem*); IsLibrariesFolder_t IsLibrariesFolder;
typedef int (*IsInLibrary_t)(class IShellItem*); IsInLibrary_t IsInLibrary;
typedef long (*GetRootLibraryFromItem_t)(class IUnknown* a1, class IUnknown** a2); GetRootLibraryFromItem_t GetRootLibraryFromItem;
typedef long (*CDUIViewFrame_GetShellView_t)(class CDUIViewFrame* a, class IShellView** b); CDUIViewFrame_GetShellView_t CDUIViewFrame_GetShellView;
typedef long (*DUIXmlParser_CreateElement_t)(class Element* This, unsigned const short*, class Element*, class Element*, unsigned long*, class Element**); DUIXmlParser_CreateElement_t DUIXmlParser_CreateElement;
typedef ATOM (*StrToID_t)(unsigned const short* resId); StrToID_t StrToID;
typedef int (*Element_GetLayoutPos_t)(Element* This); Element_GetLayoutPos_t Element_GetLayoutPos;
typedef long (*Element_SetLayoutPos_t)(Element* This, int); Element_SetLayoutPos_t Element_SetLayoutPos;
typedef long (*Element_SetVisible_t)(Element* This, bool); Element_SetVisible_t Element_SetVisible;
typedef Element* (*Element_FindDescendent_t)(class Element* This, ATOM id); Element_FindDescendent_t Element_FindDescendent;
typedef long (*Element_SetContentString_t)(class Element* This, unsigned const short*); Element_SetContentString_t Element_SetContentString;
typedef long (*Element_AddListener_t)(class Element* This, struct IElementListener*); Element_AddListener_t Element_AddListener;
typedef void (*Element_RemoveListener_t)(class Element* This, struct IElementListener*); Element_RemoveListener_t Element_RemoveListener;
typedef void* (*Button_Click_t)(); Button_Click_t Button_Click;
wchar_t* libname; std::wstring targetResid = L"FolderLayout"; std::wstring tmp; std::wstring wstr;
Element* target; Element* Root; Element* LibTitle; Element* LibDesc; Element* locationcountel;
IShellItem* ish; IShellLibrary* isl; IShellItemArray* ishArr; IShellItem* ish2;
IFolderView* pfv; IPersistFolder2* ppf2; LPITEMIDLIST pidlFolder = NULL; IShellItem* ishitem;
DWORD locationcount; bool ListenerAdded=false;
void HandleLocationCountClick(Element* elem, struct Event* iev) { if (ish) SHShowManageLibraryUI(ish, NULL, NULL, NULL, LMD_DEFAULT); }
EventListener* evl = new EventListener(HandleLocationCountClick);
long CDUIViewFrame_GetShellView_Hook(class CDUIViewFrame* a, class IShellView** b) { int ret = CDUIViewFrame_GetShellView(a, b); if (Root) { target = Element_FindDescendent( Root, StrToID((unsigned const short*)L"LibraryHeaderModule")); if (*b) (*b)->QueryInterface(IID_IFolderView, (void**)&pfv); if (pfv) pfv->GetFolder(IID_IPersistFolder2, (void**)&ppf2); if (ppf2) ppf2->GetCurFolder(&pidlFolder); if (pidlFolder) SHCreateItemFromIDList(pidlFolder, IID_IShellItem, (void**)&ish); if (target) { LibTitle = Element_FindDescendent( target, StrToID((unsigned const short*)L"LibTitle")); LibDesc = Element_FindDescendent( target, StrToID((unsigned const short*)L"LibDesc")); locationcountel = Element_FindDescendent( target, StrToID((unsigned const short*)L"locationcount")); if(ListenerAdded){ Element_RemoveListener(locationcountel, evl); ListenerAdded=false; } if (ish) { if (IsLibrary(ish)) { ish->GetDisplayName(SIGDN_NORMALDISPLAY, &libname);
isl->LoadLibraryFromItem(ish, STGM_READ);
if (isl) isl->GetFolders(LFF_ALLITEMS, IID_IShellItemArray, (void**)&ishArr);
if (libname) wstr = L"Библиотека \"" + std::wstring(libname) + L"\""; if (LibTitle && wstr.c_str()) Element_SetContentString(LibTitle, (unsigned const short*)wstr.c_str());
if (ishArr) ishArr->GetCount(&locationcount);
wstr = L"Включает:"; if (LibDesc && wstr.c_str()) Element_SetContentString(LibDesc, (unsigned const short*)wstr.c_str());
// Формирование строки с правильным склонением слова "место" if (locationcount == 1) { wstr = L"1 место"; } else if (locationcount > 1 && locationcount < 5) { wstr = std::to_wstring(locationcount) + L" места"; } else { wstr = std::to_wstring(locationcount) + L" мест"; }
if (locationcountel && wstr.c_str()) { Element_SetContentString(locationcountel, (unsigned const short*)wstr.c_str()); Element_SetVisible(locationcountel, true); Element_AddListener(locationcountel, evl); ListenerAdded = true; }
Element_SetLayoutPos(target, 1); } else if (IsInLibrary(ish) != 0) { ish->GetDisplayName(SIGDN_NORMALDISPLAY, &libname); if (LibDesc && libname) Element_SetContentString( LibDesc, (unsigned const short*)libname);
GetRootLibraryFromItem(ish, (IUnknown**)&ish2);
if (ish2) ish2->GetDisplayName(SIGDN_NORMALDISPLAY, &libname);
if (libname) wstr = L"Библиотека \"" + std::wstring(libname) + L"\""; if (LibTitle && wstr.c_str()) Element_SetContentString( LibTitle, (unsigned const short*)wstr.c_str());
if (locationcountel) Element_SetVisible(locationcountel, false); Element_SetLayoutPos(target, 1); } else if (IsLibrariesFolder(ish) != 0) { if (LibTitle) Element_SetContentString( LibTitle, (unsigned const short*)L"Библиотеки");
if (LibDesc) Element_SetContentString(LibDesc, (unsigned const short*)L"Откройте библиотеку, чтобы просмотреть файлы и отсортировать их по папке, дате и другим свойстам."); if (locationcountel) Element_SetVisible(locationcountel, false);
Element_SetLayoutPos(target, 1); } else { Element_SetLayoutPos(target, -3); } } } } return ret; }
long DUIXmlParser_CreateElement_Hook(class Element* This, unsigned const short* resid, class Element* parent, class Element* idk, unsigned long* defKey, class Element** outP) { long ret = DUIXmlParser_CreateElement(This, resid, parent, idk, defKey, outP); if (resid) tmp = (const wchar_t*)resid; if (tmp == targetResid) Root = *outP; return ret; }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit() { CoInitialize(NULL); CoCreateInstance(CLSID_ShellLibrary, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&isl)); CoCreateInstance(CLSID_ShellItem, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ish)); CoCreateInstance(CLSID_ShellItem, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ish2)); CoCreateInstance(IID_IShellItemArray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ishArr)); isl->QueryInterface(IID_IShellLibrary, (void**)&isl); ish2->QueryInterface(IID_IShellItem, (void**)&ish2); Wh_Log(L"Init"); HMODULE shell32module = LoadLibrary(L"shell32.dll"); HMODULE duimodule = LoadLibrary(L"dui70.dll");
WindhawkUtils::SYMBOL_HOOK shlHooks[] = { {// {L"int __cdecl IsLibrary(struct IShellItem *)"}, &IsLibrary, nullptr, false}, {// {L"int __cdecl IsLibrariesFolder(struct IShellItem *)"}, &IsLibrariesFolder, nullptr, false}, {// {L"int __cdecl IsInLibrary(struct IShellItem *)"}, &IsInLibrary, nullptr, false}, {// {L"GetRootLibraryFromItem"}, &GetRootLibraryFromItem, nullptr, false}, {// {L"public: virtual long __cdecl CDUIViewFrame::GetShellView(struct " L"IShellView * *)"}, &CDUIViewFrame_GetShellView, CDUIViewFrame_GetShellView_Hook, false}};
WindhawkUtils::SYMBOL_HOOK duiHooks[] = { {// {L"public: long __cdecl " L"DirectUI::DUIXmlParser::CreateElement(unsigned short const *,class " L"DirectUI::Element *,class DirectUI::Element *,unsigned long " L"*,class DirectUI::Element * *)"}, &DUIXmlParser_CreateElement, DUIXmlParser_CreateElement_Hook, false}, {// {L"public: class DirectUI::Element * __cdecl " L"DirectUI::Element::FindDescendent(unsigned short)"}, &Element_FindDescendent, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetLayoutPos(int)"}, &Element_SetLayoutPos, nullptr, false}, {// {L"StrToID"}, &StrToID, nullptr, false}, {// {L"public: int __cdecl DirectUI::Element::GetLayoutPos(void)"}, &Element_GetLayoutPos, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetContentString(unsigned " L"short const *)"}, &Element_SetContentString, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetVisible(bool)"}, &Element_SetVisible, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::AddListener(struct " L"DirectUI::IElementListener *)"}, &Element_AddListener, nullptr, false}, {// {L"public: static class UID __cdecl DirectUI::Button::Click(void)"}, &Button_Click, nullptr, false}, {// {L"public: void __cdecl DirectUI::Element::RemoveListener(struct " L"DirectUI::IElementListener *)"}, &Element_RemoveListener, nullptr, false}}; if (!WindhawkUtils::HookSymbols(duimodule, duiHooks, ARRAYSIZE(duiHooks))) { Wh_Log(L"no"); return FALSE; } if (!WindhawkUtils::HookSymbols(shell32module, shlHooks, ARRAYSIZE(shlHooks))) { Wh_Log(L"no 3"); return FALSE; } return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { CoUninitialize(); Wh_Log(L"Uninit"); }
// The mod setting were changed, reload them. void Wh_ModSettingsChanged() { Wh_Log(L"SettingsChanged"); }
Also, replace THIS in Aerexplorer fork:
{ MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), L"Жесткие диски", L"Устройства со съемными носителями", L"Другие", L"Сканеры и камеры", L"Переносные устройства мультимедиа", L"Портативные устройства" },
|
|
StouakOvsky
Sophomore Member
Oguzok, is that you?..
Posts: 101
OS: Windows 10
Theme: Windows 7 (Aero)
RAM: 4 GB
|
Post by StouakOvsky on Sept 25, 2024 0:12:42 GMT -8
RUSSIAN VERSION:
{Show code}
// ==WindhawkMod== // @id libraries-windows-7 // @name Minecraft Library mod // @description A folder is a container that helps you to organize your files. Every file on your computer is stored in a folder, and folders can also hold other folders. // @version 0.1 // @author Ojask3804 // @github https://github.com/nat // @twitter https://twitter.com/jack // @homepage https://your-personal-homepage.example.com/ // @include explorer.exe // @compilerOptions -lcomctl32 -luuid -lole32 // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Your Awesome Mod This mod is mostly made for 21H2to7 in mind and not any other mod. If you use reloaded7 then you are on your own. */ // ==/WindhawkModReadme==
// The source code of the mod starts here. This sample was inspired by the great // article of Kyle Halladay, X64 Function Hooking by Example: // http://kylehalladay.com/blog/2020/11/13/Hooking-By-Example.html // If you're new to terms such as code injection and function hooking, the // article is great to get started.
#include <exdisp.h> #include <minwindef.h> #include <shlobj.h> #include <shobjidl.h> #include <windhawk_api.h> #include <windhawk_utils.h> #include <windows.h> #include <string>
class Element;
struct IElementListener { public: virtual void OnListenerAttach(class Element* elem) = 0; virtual void OnListenerDetach(class Element* elem) = 0; virtual bool OnPropertyChanging(class Element* elem, const struct PropertyInfo* prop, int unk, class Value* before, class Value* after) = 0; virtual void OnListenedPropertyChanged(class Element* elem, const struct PropertyInfo* prop, int type, class Value* before, class Value* after) = 0; virtual void OnListenedInput(class Element* elem, struct InputEvent* event) = 0; virtual void OnListenedEvent(class Element* elem, struct Event* event) = 0; };
struct EventListener : public IElementListener { void (*f)(Element* elem, struct Event* ev); EventListener(void (*func)(Element* elem, struct Event* ev)) { f = func; } void OnListenerAttach(Element* elem) override {} void OnListenerDetach(Element* elem) override {} bool OnPropertyChanging(Element* elem, const PropertyInfo* prop, int unk, Value* v1, Value* v2) override { return true; } void OnListenedPropertyChanged(Element* elem, const PropertyInfo* prop, int type, Value* v1, Value* v2) override {} void OnListenedEvent(Element* elem, struct Event* iev) override { f(elem, iev); } void OnListenedInput(Element* elem, struct InputEvent* ev) override {} };
typedef int (*IsLibrary_t)(class IShellItem*); IsLibrary_t IsLibrary;
typedef int (*IsLibrariesFolder_t)(class IShellItem*); IsLibrariesFolder_t IsLibrariesFolder;
typedef int (*IsInLibrary_t)(class IShellItem*); IsInLibrary_t IsInLibrary;
typedef long (*GetRootLibraryFromItem_t)(class IUnknown* a1, class IUnknown** a2); GetRootLibraryFromItem_t GetRootLibraryFromItem;
typedef long (*CDUIViewFrame_GetShellView_t)(class CDUIViewFrame* a, class IShellView** b); CDUIViewFrame_GetShellView_t CDUIViewFrame_GetShellView;
typedef long (*DUIXmlParser_CreateElement_t)(class Element* This, unsigned const short*, class Element*, class Element*, unsigned long*, class Element**); DUIXmlParser_CreateElement_t DUIXmlParser_CreateElement;
typedef ATOM (*StrToID_t)(unsigned const short* resId); StrToID_t StrToID;
typedef int (*Element_GetLayoutPos_t)(Element* This); Element_GetLayoutPos_t Element_GetLayoutPos;
typedef long (*Element_SetLayoutPos_t)(Element* This, int); Element_SetLayoutPos_t Element_SetLayoutPos;
typedef long (*Element_SetVisible_t)(Element* This, bool); Element_SetVisible_t Element_SetVisible;
typedef Element* (*Element_FindDescendent_t)(class Element* This, ATOM id); Element_FindDescendent_t Element_FindDescendent;
typedef long (*Element_SetContentString_t)(class Element* This, unsigned const short*); Element_SetContentString_t Element_SetContentString;
typedef long (*Element_AddListener_t)(class Element* This, struct IElementListener*); Element_AddListener_t Element_AddListener;
typedef void (*Element_RemoveListener_t)(class Element* This, struct IElementListener*); Element_RemoveListener_t Element_RemoveListener;
typedef void* (*Button_Click_t)(); Button_Click_t Button_Click;
wchar_t* libname; std::wstring targetResid = L"FolderLayout"; std::wstring tmp; std::wstring wstr;
Element* target; Element* Root; Element* LibTitle; Element* LibDesc; Element* locationcountel;
IShellItem* ish; IShellLibrary* isl; IShellItemArray* ishArr; IShellItem* ish2;
IFolderView* pfv; IPersistFolder2* ppf2; LPITEMIDLIST pidlFolder = NULL; IShellItem* ishitem;
DWORD locationcount; bool ListenerAdded=false;
void HandleLocationCountClick(Element* elem, struct Event* iev) { if (ish) SHShowManageLibraryUI(ish, NULL, NULL, NULL, LMD_DEFAULT); }
EventListener* evl = new EventListener(HandleLocationCountClick);
long CDUIViewFrame_GetShellView_Hook(class CDUIViewFrame* a, class IShellView** b) { int ret = CDUIViewFrame_GetShellView(a, b); if (Root) { target = Element_FindDescendent( Root, StrToID((unsigned const short*)L"LibraryHeaderModule")); if (*b) (*b)->QueryInterface(IID_IFolderView, (void**)&pfv); if (pfv) pfv->GetFolder(IID_IPersistFolder2, (void**)&ppf2); if (ppf2) ppf2->GetCurFolder(&pidlFolder); if (pidlFolder) SHCreateItemFromIDList(pidlFolder, IID_IShellItem, (void**)&ish); if (target) { LibTitle = Element_FindDescendent( target, StrToID((unsigned const short*)L"LibTitle")); LibDesc = Element_FindDescendent( target, StrToID((unsigned const short*)L"LibDesc")); locationcountel = Element_FindDescendent( target, StrToID((unsigned const short*)L"locationcount")); if(ListenerAdded){ Element_RemoveListener(locationcountel, evl); ListenerAdded=false; } if (ish) { if (IsLibrary(ish)) { ish->GetDisplayName(SIGDN_NORMALDISPLAY, &libname);
isl->LoadLibraryFromItem(ish, STGM_READ);
if (isl) isl->GetFolders(LFF_ALLITEMS, IID_IShellItemArray, (void**)&ishArr);
if (libname) wstr = L"Библиотека \"" + std::wstring(libname) + L"\""; if (LibTitle && wstr.c_str()) Element_SetContentString(LibTitle, (unsigned const short*)wstr.c_str());
if (ishArr) ishArr->GetCount(&locationcount);
wstr = L"Включает:"; if (LibDesc && wstr.c_str()) Element_SetContentString(LibDesc, (unsigned const short*)wstr.c_str());
// Формирование строки с правильным склонением слова "место" if (locationcount == 1) { wstr = L"1 место"; } else if (locationcount > 1 && locationcount < 5) { wstr = std::to_wstring(locationcount) + L" места"; } else { wstr = std::to_wstring(locationcount) + L" мест"; }
if (locationcountel && wstr.c_str()) { Element_SetContentString(locationcountel, (unsigned const short*)wstr.c_str()); Element_SetVisible(locationcountel, true); Element_AddListener(locationcountel, evl); ListenerAdded = true; }
Element_SetLayoutPos(target, 1); } else if (IsInLibrary(ish) != 0) { ish->GetDisplayName(SIGDN_NORMALDISPLAY, &libname); if (LibDesc && libname) Element_SetContentString( LibDesc, (unsigned const short*)libname);
GetRootLibraryFromItem(ish, (IUnknown**)&ish2);
if (ish2) ish2->GetDisplayName(SIGDN_NORMALDISPLAY, &libname);
if (libname) wstr = L"Библиотека \"" + std::wstring(libname) + L"\""; if (LibTitle && wstr.c_str()) Element_SetContentString( LibTitle, (unsigned const short*)wstr.c_str());
if (locationcountel) Element_SetVisible(locationcountel, false); Element_SetLayoutPos(target, 1); } else if (IsLibrariesFolder(ish) != 0) { if (LibTitle) Element_SetContentString( LibTitle, (unsigned const short*)L"Библиотеки");
if (LibDesc) Element_SetContentString(LibDesc, (unsigned const short*)L"Откройте библиотеку, чтобы просмотреть файлы и отсортировать их по папке, дате и другим свойстам."); if (locationcountel) Element_SetVisible(locationcountel, false);
Element_SetLayoutPos(target, 1); } else { Element_SetLayoutPos(target, -3); } } } } return ret; }
long DUIXmlParser_CreateElement_Hook(class Element* This, unsigned const short* resid, class Element* parent, class Element* idk, unsigned long* defKey, class Element** outP) { long ret = DUIXmlParser_CreateElement(This, resid, parent, idk, defKey, outP); if (resid) tmp = (const wchar_t*)resid; if (tmp == targetResid) Root = *outP; return ret; }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit() { CoInitialize(NULL); CoCreateInstance(CLSID_ShellLibrary, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&isl)); CoCreateInstance(CLSID_ShellItem, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ish)); CoCreateInstance(CLSID_ShellItem, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ish2)); CoCreateInstance(IID_IShellItemArray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ishArr)); isl->QueryInterface(IID_IShellLibrary, (void**)&isl); ish2->QueryInterface(IID_IShellItem, (void**)&ish2); Wh_Log(L"Init"); HMODULE shell32module = LoadLibrary(L"shell32.dll"); HMODULE duimodule = LoadLibrary(L"dui70.dll");
WindhawkUtils::SYMBOL_HOOK shlHooks[] = { {// {L"int __cdecl IsLibrary(struct IShellItem *)"}, &IsLibrary, nullptr, false}, {// {L"int __cdecl IsLibrariesFolder(struct IShellItem *)"}, &IsLibrariesFolder, nullptr, false}, {// {L"int __cdecl IsInLibrary(struct IShellItem *)"}, &IsInLibrary, nullptr, false}, {// {L"GetRootLibraryFromItem"}, &GetRootLibraryFromItem, nullptr, false}, {// {L"public: virtual long __cdecl CDUIViewFrame::GetShellView(struct " L"IShellView * *)"}, &CDUIViewFrame_GetShellView, CDUIViewFrame_GetShellView_Hook, false}};
WindhawkUtils::SYMBOL_HOOK duiHooks[] = { {// {L"public: long __cdecl " L"DirectUI::DUIXmlParser::CreateElement(unsigned short const *,class " L"DirectUI::Element *,class DirectUI::Element *,unsigned long " L"*,class DirectUI::Element * *)"}, &DUIXmlParser_CreateElement, DUIXmlParser_CreateElement_Hook, false}, {// {L"public: class DirectUI::Element * __cdecl " L"DirectUI::Element::FindDescendent(unsigned short)"}, &Element_FindDescendent, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetLayoutPos(int)"}, &Element_SetLayoutPos, nullptr, false}, {// {L"StrToID"}, &StrToID, nullptr, false}, {// {L"public: int __cdecl DirectUI::Element::GetLayoutPos(void)"}, &Element_GetLayoutPos, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetContentString(unsigned " L"short const *)"}, &Element_SetContentString, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetVisible(bool)"}, &Element_SetVisible, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::AddListener(struct " L"DirectUI::IElementListener *)"}, &Element_AddListener, nullptr, false}, {// {L"public: static class UID __cdecl DirectUI::Button::Click(void)"}, &Button_Click, nullptr, false}, {// {L"public: void __cdecl DirectUI::Element::RemoveListener(struct " L"DirectUI::IElementListener *)"}, &Element_RemoveListener, nullptr, false}}; if (!WindhawkUtils::HookSymbols(duimodule, duiHooks, ARRAYSIZE(duiHooks))) { Wh_Log(L"no"); return FALSE; } if (!WindhawkUtils::HookSymbols(shell32module, shlHooks, ARRAYSIZE(shlHooks))) { Wh_Log(L"no 3"); return FALSE; } return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { CoUninitialize(); Wh_Log(L"Uninit"); }
// The mod setting were changed, reload them. void Wh_ModSettingsChanged() { Wh_Log(L"SettingsChanged"); }
Also, replace THIS in Aerexplorer fork:
{ MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), L"Жесткие диски", L"Устройства со съемными носителями", L"Другие", L"Сканеры и камеры", L"Переносные устройства мультимедиа", L"Портативные устройства" },
Hooray, thank you
|
|
kosfurler
Sophomore Member
Posts: 105
OS: Windows 10 2H22
Theme: Windows 7
|
Post by kosfurler on Sept 25, 2024 13:39:18 GMT -8
RUSSIAN VERSION:
{Show code}
// ==WindhawkMod== // @id libraries-windows-7 // @name Minecraft Library mod // @description A folder is a container that helps you to organize your files. Every file on your computer is stored in a folder, and folders can also hold other folders. // @version 0.1 // @author Ojask3804 // @github https://github.com/nat // @twitter https://twitter.com/jack // @homepage https://your-personal-homepage.example.com/ // @include explorer.exe // @compilerOptions -lcomctl32 -luuid -lole32 // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Your Awesome Mod This mod is mostly made for 21H2to7 in mind and not any other mod. If you use reloaded7 then you are on your own. */ // ==/WindhawkModReadme==
// The source code of the mod starts here. This sample was inspired by the great // article of Kyle Halladay, X64 Function Hooking by Example: // http://kylehalladay.com/blog/2020/11/13/Hooking-By-Example.html // If you're new to terms such as code injection and function hooking, the // article is great to get started.
#include <exdisp.h> #include <minwindef.h> #include <shlobj.h> #include <shobjidl.h> #include <windhawk_api.h> #include <windhawk_utils.h> #include <windows.h> #include <string>
class Element;
struct IElementListener { public: virtual void OnListenerAttach(class Element* elem) = 0; virtual void OnListenerDetach(class Element* elem) = 0; virtual bool OnPropertyChanging(class Element* elem, const struct PropertyInfo* prop, int unk, class Value* before, class Value* after) = 0; virtual void OnListenedPropertyChanged(class Element* elem, const struct PropertyInfo* prop, int type, class Value* before, class Value* after) = 0; virtual void OnListenedInput(class Element* elem, struct InputEvent* event) = 0; virtual void OnListenedEvent(class Element* elem, struct Event* event) = 0; };
struct EventListener : public IElementListener { void (*f)(Element* elem, struct Event* ev); EventListener(void (*func)(Element* elem, struct Event* ev)) { f = func; } void OnListenerAttach(Element* elem) override {} void OnListenerDetach(Element* elem) override {} bool OnPropertyChanging(Element* elem, const PropertyInfo* prop, int unk, Value* v1, Value* v2) override { return true; } void OnListenedPropertyChanged(Element* elem, const PropertyInfo* prop, int type, Value* v1, Value* v2) override {} void OnListenedEvent(Element* elem, struct Event* iev) override { f(elem, iev); } void OnListenedInput(Element* elem, struct InputEvent* ev) override {} };
typedef int (*IsLibrary_t)(class IShellItem*); IsLibrary_t IsLibrary;
typedef int (*IsLibrariesFolder_t)(class IShellItem*); IsLibrariesFolder_t IsLibrariesFolder;
typedef int (*IsInLibrary_t)(class IShellItem*); IsInLibrary_t IsInLibrary;
typedef long (*GetRootLibraryFromItem_t)(class IUnknown* a1, class IUnknown** a2); GetRootLibraryFromItem_t GetRootLibraryFromItem;
typedef long (*CDUIViewFrame_GetShellView_t)(class CDUIViewFrame* a, class IShellView** b); CDUIViewFrame_GetShellView_t CDUIViewFrame_GetShellView;
typedef long (*DUIXmlParser_CreateElement_t)(class Element* This, unsigned const short*, class Element*, class Element*, unsigned long*, class Element**); DUIXmlParser_CreateElement_t DUIXmlParser_CreateElement;
typedef ATOM (*StrToID_t)(unsigned const short* resId); StrToID_t StrToID;
typedef int (*Element_GetLayoutPos_t)(Element* This); Element_GetLayoutPos_t Element_GetLayoutPos;
typedef long (*Element_SetLayoutPos_t)(Element* This, int); Element_SetLayoutPos_t Element_SetLayoutPos;
typedef long (*Element_SetVisible_t)(Element* This, bool); Element_SetVisible_t Element_SetVisible;
typedef Element* (*Element_FindDescendent_t)(class Element* This, ATOM id); Element_FindDescendent_t Element_FindDescendent;
typedef long (*Element_SetContentString_t)(class Element* This, unsigned const short*); Element_SetContentString_t Element_SetContentString;
typedef long (*Element_AddListener_t)(class Element* This, struct IElementListener*); Element_AddListener_t Element_AddListener;
typedef void (*Element_RemoveListener_t)(class Element* This, struct IElementListener*); Element_RemoveListener_t Element_RemoveListener;
typedef void* (*Button_Click_t)(); Button_Click_t Button_Click;
wchar_t* libname; std::wstring targetResid = L"FolderLayout"; std::wstring tmp; std::wstring wstr;
Element* target; Element* Root; Element* LibTitle; Element* LibDesc; Element* locationcountel;
IShellItem* ish; IShellLibrary* isl; IShellItemArray* ishArr; IShellItem* ish2;
IFolderView* pfv; IPersistFolder2* ppf2; LPITEMIDLIST pidlFolder = NULL; IShellItem* ishitem;
DWORD locationcount; bool ListenerAdded=false;
void HandleLocationCountClick(Element* elem, struct Event* iev) { if (ish) SHShowManageLibraryUI(ish, NULL, NULL, NULL, LMD_DEFAULT); }
EventListener* evl = new EventListener(HandleLocationCountClick);
long CDUIViewFrame_GetShellView_Hook(class CDUIViewFrame* a, class IShellView** b) { int ret = CDUIViewFrame_GetShellView(a, b); if (Root) { target = Element_FindDescendent( Root, StrToID((unsigned const short*)L"LibraryHeaderModule")); if (*b) (*b)->QueryInterface(IID_IFolderView, (void**)&pfv); if (pfv) pfv->GetFolder(IID_IPersistFolder2, (void**)&ppf2); if (ppf2) ppf2->GetCurFolder(&pidlFolder); if (pidlFolder) SHCreateItemFromIDList(pidlFolder, IID_IShellItem, (void**)&ish); if (target) { LibTitle = Element_FindDescendent( target, StrToID((unsigned const short*)L"LibTitle")); LibDesc = Element_FindDescendent( target, StrToID((unsigned const short*)L"LibDesc")); locationcountel = Element_FindDescendent( target, StrToID((unsigned const short*)L"locationcount")); if(ListenerAdded){ Element_RemoveListener(locationcountel, evl); ListenerAdded=false; } if (ish) { if (IsLibrary(ish)) { ish->GetDisplayName(SIGDN_NORMALDISPLAY, &libname);
isl->LoadLibraryFromItem(ish, STGM_READ);
if (isl) isl->GetFolders(LFF_ALLITEMS, IID_IShellItemArray, (void**)&ishArr);
if (libname) wstr = L"Библиотека \"" + std::wstring(libname) + L"\""; if (LibTitle && wstr.c_str()) Element_SetContentString(LibTitle, (unsigned const short*)wstr.c_str());
if (ishArr) ishArr->GetCount(&locationcount);
wstr = L"Включает:"; if (LibDesc && wstr.c_str()) Element_SetContentString(LibDesc, (unsigned const short*)wstr.c_str());
// Формирование строки с правильным склонением слова "место" if (locationcount == 1) { wstr = L"1 место"; } else if (locationcount > 1 && locationcount < 5) { wstr = std::to_wstring(locationcount) + L" места"; } else { wstr = std::to_wstring(locationcount) + L" мест"; }
if (locationcountel && wstr.c_str()) { Element_SetContentString(locationcountel, (unsigned const short*)wstr.c_str()); Element_SetVisible(locationcountel, true); Element_AddListener(locationcountel, evl); ListenerAdded = true; }
Element_SetLayoutPos(target, 1); } else if (IsInLibrary(ish) != 0) { ish->GetDisplayName(SIGDN_NORMALDISPLAY, &libname); if (LibDesc && libname) Element_SetContentString( LibDesc, (unsigned const short*)libname);
GetRootLibraryFromItem(ish, (IUnknown**)&ish2);
if (ish2) ish2->GetDisplayName(SIGDN_NORMALDISPLAY, &libname);
if (libname) wstr = L"Библиотека \"" + std::wstring(libname) + L"\""; if (LibTitle && wstr.c_str()) Element_SetContentString( LibTitle, (unsigned const short*)wstr.c_str());
if (locationcountel) Element_SetVisible(locationcountel, false); Element_SetLayoutPos(target, 1); } else if (IsLibrariesFolder(ish) != 0) { if (LibTitle) Element_SetContentString( LibTitle, (unsigned const short*)L"Библиотеки");
if (LibDesc) Element_SetContentString(LibDesc, (unsigned const short*)L"Откройте библиотеку, чтобы просмотреть файлы и отсортировать их по папке, дате и другим свойстам."); if (locationcountel) Element_SetVisible(locationcountel, false);
Element_SetLayoutPos(target, 1); } else { Element_SetLayoutPos(target, -3); } } } } return ret; }
long DUIXmlParser_CreateElement_Hook(class Element* This, unsigned const short* resid, class Element* parent, class Element* idk, unsigned long* defKey, class Element** outP) { long ret = DUIXmlParser_CreateElement(This, resid, parent, idk, defKey, outP); if (resid) tmp = (const wchar_t*)resid; if (tmp == targetResid) Root = *outP; return ret; }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit() { CoInitialize(NULL); CoCreateInstance(CLSID_ShellLibrary, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&isl)); CoCreateInstance(CLSID_ShellItem, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ish)); CoCreateInstance(CLSID_ShellItem, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ish2)); CoCreateInstance(IID_IShellItemArray, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&ishArr)); isl->QueryInterface(IID_IShellLibrary, (void**)&isl); ish2->QueryInterface(IID_IShellItem, (void**)&ish2); Wh_Log(L"Init"); HMODULE shell32module = LoadLibrary(L"shell32.dll"); HMODULE duimodule = LoadLibrary(L"dui70.dll");
WindhawkUtils::SYMBOL_HOOK shlHooks[] = { {// {L"int __cdecl IsLibrary(struct IShellItem *)"}, &IsLibrary, nullptr, false}, {// {L"int __cdecl IsLibrariesFolder(struct IShellItem *)"}, &IsLibrariesFolder, nullptr, false}, {// {L"int __cdecl IsInLibrary(struct IShellItem *)"}, &IsInLibrary, nullptr, false}, {// {L"GetRootLibraryFromItem"}, &GetRootLibraryFromItem, nullptr, false}, {// {L"public: virtual long __cdecl CDUIViewFrame::GetShellView(struct " L"IShellView * *)"}, &CDUIViewFrame_GetShellView, CDUIViewFrame_GetShellView_Hook, false}};
WindhawkUtils::SYMBOL_HOOK duiHooks[] = { {// {L"public: long __cdecl " L"DirectUI::DUIXmlParser::CreateElement(unsigned short const *,class " L"DirectUI::Element *,class DirectUI::Element *,unsigned long " L"*,class DirectUI::Element * *)"}, &DUIXmlParser_CreateElement, DUIXmlParser_CreateElement_Hook, false}, {// {L"public: class DirectUI::Element * __cdecl " L"DirectUI::Element::FindDescendent(unsigned short)"}, &Element_FindDescendent, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetLayoutPos(int)"}, &Element_SetLayoutPos, nullptr, false}, {// {L"StrToID"}, &StrToID, nullptr, false}, {// {L"public: int __cdecl DirectUI::Element::GetLayoutPos(void)"}, &Element_GetLayoutPos, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetContentString(unsigned " L"short const *)"}, &Element_SetContentString, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::SetVisible(bool)"}, &Element_SetVisible, nullptr, false}, {// {L"public: long __cdecl DirectUI::Element::AddListener(struct " L"DirectUI::IElementListener *)"}, &Element_AddListener, nullptr, false}, {// {L"public: static class UID __cdecl DirectUI::Button::Click(void)"}, &Button_Click, nullptr, false}, {// {L"public: void __cdecl DirectUI::Element::RemoveListener(struct " L"DirectUI::IElementListener *)"}, &Element_RemoveListener, nullptr, false}}; if (!WindhawkUtils::HookSymbols(duimodule, duiHooks, ARRAYSIZE(duiHooks))) { Wh_Log(L"no"); return FALSE; } if (!WindhawkUtils::HookSymbols(shell32module, shlHooks, ARRAYSIZE(shlHooks))) { Wh_Log(L"no 3"); return FALSE; } return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { CoUninitialize(); Wh_Log(L"Uninit"); }
// The mod setting were changed, reload them. void Wh_ModSettingsChanged() { Wh_Log(L"SettingsChanged"); }
Also, replace THIS in Aerexplorer fork:
{ MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT), L"Жесткие диски", L"Устройства со съемными носителями", L"Другие", L"Сканеры и камеры", L"Переносные устройства мультимедиа", L"Портативные устройства" },
Hooray, thank you when can you send russian control panel? and can I help with translation?
|
|
StouakOvsky
Sophomore Member
Oguzok, is that you?..
Posts: 101
OS: Windows 10
Theme: Windows 7 (Aero)
RAM: 4 GB
|
Post by StouakOvsky on Sept 25, 2024 18:19:25 GMT -8
when can you send russian control panel? and can I help with translation? I think I want to translate the README files, but I downloaded the latest Windows ISO file, so I can start translating in full.
|
|
technicalissues
Sophomore Member
Windows 10 that is 1:1 to 7; coming soon
Posts: 157
OS: Windows 10 22H2
Theme: Windows 7 Visuals and functions
CPU: Intel i5-13400F
RAM: 16GB DDR5
GPU: NVIDIA RTX 4060
|
Post by technicalissues on Sept 30, 2024 4:04:34 GMT -8
this mod is broken, throws a [no member named strcpy_instead_use_StringCbCopyA_or_StringCchCopyA in the global namespace] error
Aerxplorer fork is okay, but the headers mod throws that
|
|
|
Post by hanssepp123 on Oct 27, 2024 13:23:02 GMT -8
Found a bug when having diffrent dpi screens e.g. 150% and 100%. If you move the Explorer Windows with an open Library from the 100% to 150% and vice versa than the Library Locations dialog opens.
|
|