Files
Work/hookproc/ENUMWIN.HPP
2024-08-07 09:16:27 -04:00

46 lines
1.1 KiB
C++

#ifndef _HOOKPROC_ENUMWINDOWSHOOK_HPP_
#define _HOOKPROC_ENUMWINDOWSHOOK_HPP_
#ifndef _HOOKPROC_APIENTRY_HPP_
#include <hookproc/apientry.hpp>
#endif
#ifndef _HOOKPROC_PROCADDRESS_HPP_
#include <hookproc/procaddr.hpp>
#endif
class EnumWindowsHook;
typedef ProcAddress<EnumWindowsHook> EnumWindowsHookProc;
class EnumWindowsHook : protected APIEntry, private EnumWindowsHookProc
{
public:
typedef int (__stdcall *LPFNENUMWINDOWPROC)(HWND hWnd,LPARAM lParam);
EnumWindowsHook(void);
virtual ~EnumWindowsHook();
DWORD getHookAddress(void);
protected:
virtual bool enumWindowsProc(HWND hWnd,LPARAM lParam);
private:
enum {ParamLength=8};
EnumWindowsHook &operator=(const EnumWindowsHook &someEnumWindowsHook);
bool entryProc(HWND hWnd,LPARAM lParam);
};
inline
EnumWindowsHook::EnumWindowsHook(void)
: APIEntry(ParamLength,(DWORD)this,getProcAddress((ProcAddress<EnumWindowsHook>::LPFNMETHODVOID)&EnumWindowsHook::entryProc))
{
}
inline
EnumWindowsHook &EnumWindowsHook::operator=(const EnumWindowsHook &someEnumWindowsHook)
{ // no implementation
return *this;
}
inline
DWORD EnumWindowsHook::getHookAddress(void)
{
return codeBase();
}
#endif