diff --git a/LunaTranslator/LunaTranslator/scalemethod/SW_SHOWMAXIMIZED.py b/LunaTranslator/LunaTranslator/scalemethod/SW_SHOWMAXIMIZED.py deleted file mode 100644 index 838108b0..00000000 --- a/LunaTranslator/LunaTranslator/scalemethod/SW_SHOWMAXIMIZED.py +++ /dev/null @@ -1,11 +0,0 @@ -from scalemethod.base import scalebase -from winsharedutils import letfullscreen, recoverwindow - - -class Method(scalebase): - def changestatus(self, hwnd, full): - if full: - self.savewindowstatus = letfullscreen(hwnd) - else: - recoverwindow(hwnd, self.savewindowstatus) - return True \ No newline at end of file diff --git a/LunaTranslator/LunaTranslator/scalemethod/alt_enter.py b/LunaTranslator/LunaTranslator/scalemethod/alt_enter.py deleted file mode 100644 index 7875e4f9..00000000 --- a/LunaTranslator/LunaTranslator/scalemethod/alt_enter.py +++ /dev/null @@ -1,13 +0,0 @@ -from scalemethod.base import scalebase -import windows - - -class Method(scalebase): - def changestatus(self, hwnd, full): - windows.SetForegroundWindow(hwnd) - windows.keybd_event(18, 0, 0, 0) # alt - windows.keybd_event(13, 0, 0, 0) # enter - - windows.keybd_event(13, 0, windows.KEYEVENTF_KEYUP, 0) - windows.keybd_event(18, 0, windows.KEYEVENTF_KEYUP, 0) - return True \ No newline at end of file diff --git a/LunaTranslator/LunaTranslator/winsharedutils.py b/LunaTranslator/LunaTranslator/winsharedutils.py index 1de8b7f9..d406e90a 100644 --- a/LunaTranslator/LunaTranslator/winsharedutils.py +++ b/LunaTranslator/LunaTranslator/winsharedutils.py @@ -7,7 +7,6 @@ from ctypes import ( pointer, CDLL, c_int, - Structure, c_void_p, cast, memmove, @@ -15,14 +14,12 @@ from ctypes import ( create_string_buffer, c_size_t, windll, - c_float, c_double, c_char, CFUNCTYPE, c_long, ) -from ctypes.wintypes import WORD, HANDLE, HWND, LONG, DWORD, RECT -from windows import WINDOWPLACEMENT +from ctypes.wintypes import WORD, HWND, DWORD, RECT import gobject utilsdll = CDLL(gobject.GetDllpath(("winsharedutils32.dll", "winsharedutils64.dll"))) @@ -258,17 +255,6 @@ showintab = utilsdll.showintab showintab.argtypes = HWND, c_bool, c_bool -class windowstatus(Structure): - _fields_ = [("wpc", WINDOWPLACEMENT), ("HWNDStyle", LONG), ("HWNDStyleEx", LONG)] - - -letfullscreen = utilsdll.letfullscreen -letfullscreen.argtypes = (HWND,) -letfullscreen.restype = windowstatus - -recoverwindow = utilsdll.recoverwindow -recoverwindow.argtypes = HWND, windowstatus - pid_running = utilsdll.pid_running pid_running.argtypes = (DWORD,) pid_running.restype = c_bool diff --git a/LunaTranslator/files/defaultconfig/static_data.json b/LunaTranslator/files/defaultconfig/static_data.json index 5934d0f5..dfe5ca88 100644 --- a/LunaTranslator/files/defaultconfig/static_data.json +++ b/LunaTranslator/files/defaultconfig/static_data.json @@ -1957,14 +1957,10 @@ }, "scalemethods": [ "magpie_builtin", - "alt_enter", - "SW_SHOWMAXIMIZED", "external_magpie" ], "scalemethods_vis": [ "Magpie", - "ALT+ENTER", - "SW_SHOWMAXIMIZED", "Magpie_External" ], "transoptimi": [ diff --git a/plugins/winsharedutils/hwnd.cpp b/plugins/winsharedutils/hwnd.cpp index eecb2253..6e196668 100644 --- a/plugins/winsharedutils/hwnd.cpp +++ b/plugins/winsharedutils/hwnd.cpp @@ -22,38 +22,6 @@ DECLARE void showintab(HWND hwnd, bool show, bool tool) SetWindowLong(hwnd, GWL_EXSTYLE, style_ex); } -struct windowstatus -{ - WINDOWPLACEMENT wpc; - LONG HWNDStyle, HWNDStyleEx; -}; - -DECLARE windowstatus letfullscreen(HWND hwnd) -{ - WINDOWPLACEMENT wpc; - GetWindowPlacement(hwnd, &wpc); - auto HWNDStyle = GetWindowLong(hwnd, GWL_STYLE); - auto HWNDStyleEx = GetWindowLong(hwnd, GWL_EXSTYLE); - auto NewHWNDStyle = HWNDStyle; - NewHWNDStyle &= ~WS_BORDER; - NewHWNDStyle &= ~WS_DLGFRAME; - NewHWNDStyle &= ~WS_THICKFRAME; - auto NewHWNDStyleEx = HWNDStyleEx; - NewHWNDStyleEx &= ~WS_EX_WINDOWEDGE; - SetWindowLong(hwnd, GWL_STYLE, NewHWNDStyle | WS_POPUP); - SetWindowLong( - hwnd, GWL_EXSTYLE, NewHWNDStyleEx | WS_EX_TOPMOST); - ShowWindow(hwnd, SW_SHOWMAXIMIZED); - return {wpc, HWNDStyle, HWNDStyleEx}; -} - -DECLARE void recoverwindow(HWND hwnd, windowstatus status) -{ - SetWindowLong(hwnd, GWL_STYLE, status.HWNDStyle); - SetWindowLong(hwnd, GWL_EXSTYLE, status.HWNDStyleEx); - ShowWindow(hwnd, SW_SHOWNORMAL); - SetWindowPlacement(hwnd, &status.wpc); -} DECLARE bool pid_running(DWORD pid) { DWORD code;