title: Python ctypes use winmode to load DLLs
body: <p>I've installed an C++ API application which puts a couple of DLLs (<code>A.DLL</code> and <code>B.DLL</code>) in my programs folder. <code>A.DLL</code> has a dependency on <code>B.DLL</code></p>
  <p>I can load them successfully with <code>ctypes.WinDLL</code> IF from the installation folder like <code>C:\Programs Files\XXX-API\A.DLL</code></p>
  <p>while if I move the folder to another place <code>C:\TEMP\</code> , the Python cytes load will complain that it can't find <code>B.DLL</code>.</p>
  <p>I'm looking into the <a href="https://docs.python.org/3/library/ctypes.html#ctypes.WinDLL" rel="nofollow noreferrer">winmode</a>, looks like it will solve the problem. The <code>winmode</code> seems to take an integer from parameters in <a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa" rel="nofollow noreferrer">MS reference</a> .</p>
  <p>for example :</p>
  <blockquote>
  <p>LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR</p>
  <p>0x00000100</p>
  </blockquote>
  <p>To use <code>LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR</code> ,to pass <code>0x00000100</code> as <code>256</code> to <code>winmode </code> ? ctype will complain can not find <code>B.DLL</code>,I'm not sure what's missing ,appreciate any idea from you ,thanks !</p>
  <pre><code>ctypes.WinDLL(path_to_A_DLL , winmode = 256 )
  </code></pre>