tags:

views:

113

answers:

1

I'm trying to maximize a specific window with python...

Here is the deal: I have a script that opens 2 firefox windows (selenium rc), and I need to maximize the second window, the last one that opens... How can I do it?

I'm using this command

window = win32gui.GetForegroundWindow()
win32gui.MoveWindow(window, 0, 0, 1440, 900, True)

that works perfectly, but only with the focus window... and the second window of firefox witch opens with the script doesnt get focused...

+3  A: 

This should work

import win32gui, win32con

hwnd = win32gui.GetForegroundWindow()
win32gui.ShowWindow(hwnd, win32con.SW_MAXIMIZE)
ars
TypeError: function takes exactly 3 arguments (2 given)
Shady
sorry, it's `ShowWindow` instead of `SetWindowLong` -- updated above
ars