I need help for a project that uses Microsoft Detours.
Premise: I am trying to use a class I found in a project on CodeProject that uses the Detours library. I downloaded the latest version of Detuors from Github and recompiled it, but I can't find the definition of the macro DETOUR_TRAMPOLINE
. I imagine that in the new version of Detours it has been replaced in some way.
In the project that uses this missing macro, it's used like this:
DETOUR_TRAMPOLINE(BOOL WINAPI Detour_EnableScrollBar(HWND hwnd, int wSBflags, UINT wArrows), EnableScrollBar);
DETOUR_TRAMPOLINE(BOOL WINAPI Detour_GetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi), GetScrollInfo);
DETOUR_TRAMPOLINE(int WINAPI Detour_GetScrollPos (HWND hwnd, int nBar), GetScrollPos);
DETOUR_TRAMPOLINE(BOOL WINAPI Detour_GetScrollRange (HWND hwnd, int nBar, LPINT lpMinPos, LPINT lpMaxPos), GetScrollRange);
DETOUR_TRAMPOLINE(int WINAPI Detour_SetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw), SetScrollInfo);
DETOUR_TRAMPOLINE(int WINAPI Detour_SetScrollPos (HWND hwnd, int nBar, int nPos, BOOL fRedraw), SetScrollPos);
DETOUR_TRAMPOLINE(int WINAPI Detour_SetScrollRange (HWND hwnd, int nBar, int nMinPos, int nMaxPos, BOOL fRedraw), SetScrollRange);
DETOUR_TRAMPOLINE(BOOL WINAPI Detour_ShowScrollBar (HWND hwnd, int wBar, BOOL fShow), ShowScrollBar);
Question:
Thanks in advance for the help!
As JHBonarius explained in his comment, many versions of Detours have been released since the macro in question was deleted, so it's probably not so easy to make a quick change to the code in question.
I wanted to point out to those interested a very simple and contained library that, like Detours, allows you to redirect the Windows API (even if it provides much less functionality).
The library in question is MinHook, and the source code is still available here.