Python: win32gui.SetForegroundWindow
<p>Hi I have just written simple script to launch an applciation. and I am trying to use "SendKeys" module to send keystrokes to this application. There is one <code>"Snapshot"</code> button . But I cant get python to click  <code>"Snapshot"</code> button as the new window is not in focus. so I am planning to use Win32gui module's <code>win32gui.FindWindow</code> and <code>win32gui.SetForegroundWindow</code> functionality . But it gives me <code>error- invalid handle</code>. My app name is "DMCap"</p>

<p>here is code snippet in python</p>

<pre><code>handle = win32gui.FindWindow(0, "DMCap")  //paassing 0 as I dont know classname 
win32gui.SetForegroundWindow(handle)  //put the window in foreground
</code></pre>

<p>can anyone help me . is this pythin code correct? Can i send handle directly like this.</p>
