title: DLL injection prior to process execution
body: <p>I am trying to use dll injection to intercept a call to <code>Direct3DCreate8</code> from my application to acquire a handle to the Direct3d device and draw an overlay on the screen that it projects. The call to this API happens right after the application's execution which, if I understand correctly, renders useless the <strong>dll injection into running process</strong> technique as the API call I was after has already happened when I inject the dll. 
  Is this assumption correct? If yes, how can one inject the dll during process execution to catch a desired API call?</p>
  
  <p><strong>EDIT:</strong> I am aware of system-wide api hooks but would be nice to hear a 'local' solution to this problem.</p>
  
  <p><strong>EDIT 2:</strong> Forgot to mention, replacing the .dll in the application's folder is of no use, as the application looks for the .dll (d3d8.dll in my case) in System32/SysWOW64 directories.</p>