title: Hooking windows API functions to intercept dll loading (Windows only)
body: <p>I want to intercept dll's loading so I can use them. My first idea was to hook GetProcAddress. Surprisingly, by hooking it, I can only intercept calls made within the process that owns my library. (I opened another executables that call GetProcAddress and those calls don't get intercepted) (I guess because it is dynamically compiled against my lib)</p>
  
  <p>Example of the output:</p>
  
  <blockquote>
    <p>C:\Windows\syswow64\kernel32.dll
    Module32NextW</p>
    
    <p>C:\Windows\syswow64\kernel32.dll
    CreateToolhelp32Snapshot</p>
    
    <p>C:\Windows\system32\DINPUT.dll
    DirectInputCreateW</p>
    
    <p>C:\Windows\SysWOW64\ntdll.dll
    DirectDrawCreate</p>
  </blockquote>
  
  <p>Anyway, what I want to know is where I should start to be able to intercept dlls loading so I can then use their functions. </p>
  
  <p>Basically, I want to be able to call GetModuleInformation for any dll loaded.</p>