There's a lot of useful stuff that just can not be done in DllMain. Read all relating articles in Raymond Chen's blog for more info. Can't even delay execution with SetTimer, because that function is in user32.dll, and that library may not be loaded yet.