title: How do I know what parameters a DLL function requires?
body: <p>I am trying to load a DLL using <code>ctypes</code> in order to run some functions from the <code>ASWHook.dll</code> file that comes with the old AutoHotKey AutoScriptWriter.  I am able to use a program to view the function names, but I cannot figure out why <code>ctypes</code> is crashing when I try to call a function.  I'm guessing it's because the functions need parameters, but the program I'm using doesn't tell you any of that information.  The program I'm using is called "DLL Export Viewer"</p>
  
  <p>The function I'm trying to call is called <code>GetKeyInfo</code>, and this is what I'm doing in my script.</p>
  
  <pre><code>import ctypes
  d = ctypes.WinDLL ("C:\\Users\\Username\\Desktop\\AHK\\AutoScriptWriter\\ASWHook.dll")
  f = d['GetKeyInfo']
  v = f()
  </code></pre>
  
  <p>This causes the python interpreter to freeze and then restart.  I'm not sure if <code>GetKeyInfo</code> takes any parameters, but either way, it's crashing when I try to use it.  Is there a better way to inspect the DLL in order to get more information about what parameters the functions take?</p>
  
  <p>Sorry if this is simple stuff, I'm new to using DLLs in general, so I'm not exactly sure.</p>
  
  <p>I was looking at <a href="https://stackoverflow.com/a/252473/2930045">this answer</a> on how to use the DLLs, but it was really confusing.  </p>
  
  <p>I'm working off <a href="https://stackoverflow.com/a/5253910/2930045">this example</a> now.</p>