/* */
in the dynamic link libraryHHOOK g_CbtHook=NULL;
HMOUDLE HMOUDLE=NULL;
DLLMAIN (a,)
{
.
DLL_ATTACH:
Hmoudle=a;
break;
.
}
LRESULT a CALLBACK CbtProc (,,)
{
Return CallNextHook ();
}
SetHook (LPWSTR ProcessName)
{
DwProcessId=GetprocessIdByName (ProcessName);//success find out the process ID
G_CbtHook=SetWindowsHookEx (WH_CBT CbtProc, hmoudle, dwProcessId);
Int a=GetLastError ();// this error to 87
}