import win32api<br>import win32ui<br>window = win32ui.FindWindow(None, &quot;123.txt&quot;)<br>yourwindow.ShowWindow()<br><br>Traceback (most recent call last):<br>&nbsp; File &quot;C:/python codes/gain_focus.py&quot;, line 3, in &lt;module&gt;
<br>&nbsp;&nbsp;&nbsp; window = win32ui.FindWindow(None, &quot;123.txt&quot;)<br>win32ui: No window can be found.<br>