title: Installing win32gui python module
body: <p>I am trying to get the name of the window currently in focus by running this code...</p>
  
  <pre><code>import win32gui
  name = win32gui.GetForegroundWindow()
  </code></pre>
  
  <p>However, I keep getting</p>
  
  <pre><code>Traceback (most recent call last):
  File "D:\Program_1\test.py", line 1, in &lt;module&gt;
  import win32gui
  ImportError: No module named win32gui
  </code></pre>
  
  <p>I installed pywin32 from here <a href="http://sourceforge.net/projects/pywin32/?source=navbar" rel="noreferrer">http://sourceforge.net/projects/pywin32/?source=navbar</a> .
  What is the mistake I am making; guessing it is something very basic.
  Thanks in advance.</p>
  
  <p>EDIT:
  Found the solution.
  I was installing a 32bit pywin32 on a 64bit Windows 7 because the 64bit version gave me an error, it could not find the Python registry. I found a solution here <a href="https://stackoverflow.com/questions/3008509/python-version-2-6-required-which-was-not-found-in-the-registry">Python version 2.6 required, which was not found in the registry</a> . Reinstalling Python and installing it just for myself resulted in no errors given by pywin32 64bit installation.</p>