Layouter
.py
Windows disposition for some windows in Windows
"""
Set position and sizes for some windows in Windows
"""
import win32gui
= 0
HWND_TOP = 0x4000
SWP_ASYNCWINDOWPOS = 1
SW_SHOWNORMAL
# enumerate top-level windows
def ec(h, r):
= win32gui.GetWindowText(h)
t
r.append((h, t))= []
z
win32gui.EnumWindows(ec, z)
# common options
= HWND_TOP
hWndInsertAfter = SWP_ASYNCWINDOWPOS
uFlags = SW_SHOWNORMAL
nCmdShow
# "<...folder...> - Outlook"
= next(filter(lambda x: x[1].endswith(' - Outlook'), z))[0]
hWnd 1929, 296, 3447-1929, 1166-296, uFlags)
win32gui.SetWindowPos(hWnd, hWndInsertAfter,
win32gui.ShowWindow(hWnd, nCmdShow)
# "Lync"
= next(filter(lambda x: x[1] == 'Lync', z))[0]
hWnd 3454, 124, 3840-3454, 1165-124, uFlags)
win32gui.SetWindowPos(hWnd, hWndInsertAfter, win32gui.ShowWindow(hWnd, nCmdShow)