switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
break;
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
break;
}
return TRUE;
}
LRESULT CALLBACK GetMsgProc(int code, WPARAM wParam, LPARAM lParam)
{
// g_hHook is ignored since from NT according to latest MSDN
if (hThread == NULL)
{
//hThread = CreateThread(NULL, 0, ThreadProcMonitor, NULL, 0, NULL);
hThread = (HANDLE)_beginthreadex(NULL,0,ThreadProcMonitor,NULL,0,NULL);
}