Skip to content

Commit

Permalink
Remove unnecessary include
Browse files Browse the repository at this point in the history
  • Loading branch information
aubymori committed Oct 8, 2024
1 parent e60546c commit 3eca7c4
Showing 1 changed file with 45 additions and 46 deletions.
91 changes: 45 additions & 46 deletions mods/classic-list-group-fix.wh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ This mod makes list group headers in classic theme look as they did in Windows X

#include <commctrl.h>
#include <windhawk_utils.h>
#include <winreg.h>

#ifdef _WIN64
# define STHISCALL L"__cdecl"
Expand Down Expand Up @@ -177,6 +176,49 @@ HMODULE LoadComCtlModule(void)
return hComCtl;
}

const WindhawkUtils::SYMBOL_HOOK comctl32DllHooks[] = {
{
{
L"public: int "
STHISCALL
L" CListGroup::GetGroupRect(struct tagRECT *)const "
},
&CListGroup_GetGroupRect_orig,
CListGroup_GetGroupRect_hook,
false
},
{
{
L"private: void "
STHISCALL
L" CListGroup::_PaintHeader(unsigned long,struct tagNMLVCUSTOMDRAW *)"
},
&CListGroup__PaintHeader_orig,
CListGroup__PaintHeader_hook,
false
},
{
{
L"public: int "
STHISCALL
L" CListGroup::HeaderHeight(void)const "
},
&CListGroup_HeaderHeight_orig,
CListGroup_HeaderHeight_hook,
false
},
{
{
L"private: void "
STHISCALL
L" CListGroup::_PaintCollapse(struct tagNMLVCUSTOMDRAW *)"
},
&CListGroup__PaintCollapse_orig,
CListGroup__PaintCollapse_hook,
false
}
};

void Wh_ModSettingsChanged(void)
{
g_fHideCollapse = Wh_GetIntSetting(L"hidecollapse");
Expand All @@ -194,53 +236,10 @@ BOOL Wh_ModInit(void)
return FALSE;
}

WindhawkUtils::SYMBOL_HOOK hooks[] = {
{
{
L"public: int "
STHISCALL
L" CListGroup::GetGroupRect(struct tagRECT *)const "
},
&CListGroup_GetGroupRect_orig,
CListGroup_GetGroupRect_hook,
false
},
{
{
L"private: void "
STHISCALL
L" CListGroup::_PaintHeader(unsigned long,struct tagNMLVCUSTOMDRAW *)"
},
&CListGroup__PaintHeader_orig,
CListGroup__PaintHeader_hook,
false
},
{
{
L"public: int "
STHISCALL
L" CListGroup::HeaderHeight(void)const "
},
&CListGroup_HeaderHeight_orig,
CListGroup_HeaderHeight_hook,
false
},
{
{
L"private: void "
STHISCALL
L" CListGroup::_PaintCollapse(struct tagNMLVCUSTOMDRAW *)"
},
&CListGroup__PaintCollapse_orig,
CListGroup__PaintCollapse_hook,
false
}
};

if (!WindhawkUtils::HookSymbols(
hComCtl,
hooks,
ARRAYSIZE(hooks)
comctl32DllHooks,
ARRAYSIZE(comctl32DllHooks)
))
{
Wh_Log(L"Failed to hook one or more symbol functions");
Expand Down

0 comments on commit 3eca7c4

Please sign in to comment.