[python-win32] BringWindowToTop doesn't work, anyone have try it?
Tim Roberts
timr at probo.com
Fri Oct 22 18:57:50 CEST 2010
nathon py wrote:
> # Let's say a window with title 'D:\\labBufferSpace' exists.
> # Code below does not work in DOS, or just double it.
> # But it works well in PythonWin.
> # I do not want to run it in PythonWin every time.
> # I take it as a bug, and reported it to sourceforge.net
> <http://sourceforge.net>, did I do that wrong?
> ########################################################
> import win32ui,win32con,pythoncom,win32gui,win32process,win32api
> pwin = win32gui.FindWindow(0,'D:\\labBufferSpace')
> win32gui.BringWindowToTop(pwin)
If it is a bug, it is a bug in the Win32 API. This same code also does
not work in a console app written in C.
Use SetForegroundWindow instead of BringWindowToTop. That works.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list