Hi All,
We found the way to do that. Now we added the following block of code in the entry point of the injecting dll.And it is working fine.
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, PVOID lpReserved) <br />
{ <br />
switch (dwReason) <br />
{ <br />
case DLL_PROCESS_ATTACH: <br />
IsDebuggerPresent(); <br />
<br />
GetModuleFileName( GetModuleHandle( NULL ),Work,sizeof(Work) ); <br />
PathStripPath(Work ); <br />
<br />
if ( _stricmp( Work, "someapplication.exe" ) != 0 ) <br />
{ <br />
InstallWindowHooks(); <br />
} <br />
<br />
break; <br />
case DLL_PROCESS_DETACH: <br />
hWindowReceiver = NULL; <br />
CleanUp(); <br />
break; <br />
} <br />
return TRUE; <br />
}
Thank you.