From c0dc255bc81f02631c9a34281f5c3d0db8873ec5 Mon Sep 17 00:00:00 2001 From: Usermode Date: Sat, 6 Apr 2024 10:13:24 +0900 Subject: [PATCH] Update main.py --- main.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 349c193..7210001 100644 --- a/main.py +++ b/main.py @@ -55,9 +55,21 @@ import pywintypes import win32gui -hwnd = win32gui.FindWindow(None, title_with_version) -x0, y0, x1, y1 = win32gui.GetWindowRect(hwnd) -win32gui.MoveWindow(hwnd, x0, y0, x0+1536, y0+864, True) +try: + hwnd = win32gui.FindWindow(None, title_with_version) + x0, y0, x1, y1 = win32gui.GetWindowRect(hwnd) + win32gui.MoveWindow(hwnd, x0, y0, x0+1536, y0+864, True) +except: + try: + first_except = f"관리자: {title_with_version}" + hwnd = win32gui.FindWindow(None, first_except) + x0, y0, x1, y1 = win32gui.GetWindowRect(hwnd) + win32gui.MoveWindow(hwnd, x0, y0, x0+1536, y0+864, True) + except: + second_except = f"Administrator: {title_with_version}" + hwnd = win32gui.FindWindow(None, second_except) + x0, y0, x1, y1 = win32gui.GetWindowRect(hwnd) + win32gui.MoveWindow(hwnd, x0, y0, x0+1536, y0+864, True) def program_exit(status: int): # so we don't need to import the entire sys module log(f"exited program with error code {status}")