Glossary and terms:

1, Target, or target function, or target method, or target procedure
The code address or function to be hooked.

2, Hook, or hook function, or hook method, or hook procedure
The code address or function to intercept the target.

3, Caller, or caller function, or caller method, or caller procedure
Sames as calling function.
The code address or function which is invoking another function.

4, Calling convention
The convention of which register used to pass parameters, the order that the parameters are pushed on the stack, and who (the calling or called function) cleans the stack.

5, "this" pointer
Known as "Self" pointer in Delphi. A pointer to an object instance itself.
6, Raw mode hooking, or low level hooking
Win32 CodeHook connects your hook function to the target function directly.
It's your responsibility to deal with the calling convention, prototype of the target and hook function.
Usually this method requires the hook function has exactly same prototype with the target.

7, Advanced mode hooking, or high level hooking
Win32 CodeHook generates a piece of thumb code (bridge code), then connects your hook function to the target function via the bridge code.

8, Extra parameters.
In advanced hooking, you can specify some extra parameters to the hook function. This feature is very useful to use an object function (class member function) as a hook because you can pass 'Self' pointer ('this' pointer, in C++) as an extra parameter.

9, Global function.
The functions declared in the global scope, not in any class. For instance, all Win32 APIs exported by Windows user32.dll are global function.

10, Object function, or class member function.
The functions declared in a class or interface. For instance, all functions declared in an interface is object function.
Such functions require a "this" pointer.
For Delphi users, the class functions should be treated as object functions because they require "Self".

Start hooking

Get the root hook interface (ICodeHook)
Win32 CodeHook exposes all functions in interfaces.
You can obtain the root interface through the API GetCodeHook to get the global interface.
You can read the tutorial for more information.

Get other hook interfaces
All other non-root interfaces can be obtained from the root interface. Use ICodeHook.GetDirectCodeHook to get IDirectCodeHook, and ICodeHook.GetCodeHookHelper to get ICodeHookHelper.

Interfaces overview:

ICodeHook
The kernel interface that supports both raw mode and advanced mode hooking.

ICodeHookHelper
A wrapper interface of ICodeHook. This interface make it's more easier to use ICodeHook.

IDirectCodeHook
Low level (raw mode) hook. Usually you don't need this interface. Use ICodeHook instead.

IErrorCodeHook
Get the error code and error message.