Two Step DLL Inection (How to get thread handle?)
So I want two create a 2 step DLL injection process, the first level is a very unobtrusive global DLL:
SetWindowsHookEx -> parameter 4 = 0 -> Global injection.
this dll then observes which process it attaches to:
so basically after I verify that the object currently being attached is of a specific type I want to attach my 2nd hook, but only into this process. Using SetWindowsHookEx(), i need the DWORD threadID for this process, but I'm not sure how to get it from the HMODULE given in the DLLMain, any suggestions?
BOOL APIENTRY DllMain( HMODULE hModule,
LPVOID lpReserved )
if ( GetModuleHandle( _T("Process.exe") ) != NULL )
// inject 2nd dll ONLY into this thread