Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 2879b662dc
@ttencate
26 lines (22 sloc) 0.462 kB
#include "hook.hpp"
#include "debug.hpp"
Hook::Hook(int type, HOOKPROC proc)
:
d_type(type),
d_proc(proc),
d_handle(NULL)
{
}
bool Hook::attach() {
ASSERT(!attached());
d_handle = SetWindowsHookEx(d_type, d_proc, GetModuleHandle(NULL), NULL);
return d_handle != NULL;
}
bool Hook::detach() {
ASSERT(attached());
bool success = true;
if (!UnhookWindowsHookEx(d_handle))
success = false;
d_handle = NULL;
return success;
}
Jump to Line
Something went wrong with that request. Please try again.