###User Defined Function###
_WinAPI_SetWindowsHookEx

###Description###
Installs an application-defined hook procedure into a hook chain

###Syntax###
#include <WinAPI.au3>
_WinAPI_SetWindowsHookEx ( $idHook, $lpfn, $hmod [, $dwThreadId = 0] )


###Parameters###
@@ParamTable@@
$idHook
	Specifies the type of hook procedure to be installed. This parameter can be one of the following values:
	$WH_CALLWNDPROC - Installs a hook procedure that monitors messages before the system sends them to the destination window procedure
	$WH_CALLWNDPROCRET - Installs a hook procedure that monitors messages after they have been processed by the destination window procedure
	$WH_CBT - Installs a hook procedure that receives notifications useful to a computer-based training (CBT) application
	$WH_DEBUG - Installs a hook procedure useful for debugging other hook procedures
	$WH_FOREGROUNDIDLE - Installs a hook procedure that will be called when the application's foreground thread is about to become idle
	$WH_GETMESSAGE - Installs a hook procedure that monitors messages posted to a message queue
	$WH_JOURNALPLAYBACK - Installs a hook procedure that posts messages previously recorded by a $WH_JOURNALRECORD hook procedure
	$WH_JOURNALRECORD - Installs a hook procedure that records input messages posted to the system message queue
	$WH_KEYBOARD - Installs a hook procedure that monitors keystroke messages
	$WH_KEYBOARD_LL - Installs a hook procedure that monitors low-level keyboard input events
	$WH_MOUSE - Installs a hook procedure that monitors mouse messages
	$WH_MOUSE_LL - Installs a hook procedure that monitors low-level mouse input events
	$WH_MSGFILTER - Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar
	$WH_SHELL - Installs a hook procedure that receives notifications useful to shell applications
	$WH_SYSMSGFILTER - Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar
$lpfn
	Pointer to the hook procedure. If the $dwThreadId parameter is zero or specifies the identifier of a thread created by a different process,
	the $lpfn parameter must point to a hook procedure in a DLL.
	Otherwise, $lpfn can point to a hook procedure in the code associated with the current process
$hmod
	Handle to the DLL containing the hook procedure pointed to by the $lpfn parameter.
	The $hMod parameter must be set to NULL if the $dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the
	code associated with the current process
$dwThreadId
	[optional] Specifies the identifier of the thread with which the hook procedure is to be associated.
	If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	Handle to the hook procedure
Failure:	0, call <a href="_WinAPI_GetLastError.htm">_WinAPI_GetLastError()</a> to get extended error informationt
@@End@@


###Remarks###
None.


###Related###
_WinAPI_UnhookWindowsHookEx, _WinAPI_CallNextHookEx


###See Also###
@@MsdnLink@@ SetWindowsHookEx


###Example###
@@IncludeExample@@
