import win32api import win32gui, win32con import win32clipboard import re import time
class cWindow: def __init__(self): self._hwnd = None
def SetAsForegroundWindow(self): win32gui.SetForegroundWindow(self._hwnd)
def Maximize(self): win32gui.ShowWindow(self._hwnd, win32con.SW_MAXIMIZE)
def _window_enum_callback(self, hwnd, regex): if self._hwnd is None and re.match(regex, str(win32gui.GetWindowText(hwnd))) is not None: self._hwnd = hwnd
def find_window_regex(self, regex): self._hwnd = None win32gui.EnumWindows(self._window_enum_callback, regex)
def hide_always_on_top_windows(self): win32gui.EnumWindows(self._window_enum_callback_hide, None)
def _window_enum_callback_hide(self, hwnd, unused): if hwnd != self._hwnd: if win32gui.IsWindowVisible(hwnd) and win32gui.GetWindowLong(hwnd, win32con.GWL_EXSTYLE) & win32con.WS_EX_TOPMOST: className = win32gui.GetClassName(hwnd) if not (className == 'Button' or className == 'Shell_TrayWnd'): win32gui.ShowWindow(hwnd, win32con.SW_FORCEMINIMIZE)
regex = ".*x32dbg.*" cW = cWindow() cW.find_window_regex(regex)
cW.SetAsForegroundWindow()
win32api.keybd_event(0x72, 0, 0, 0) win32api.keybd_event(0x72, 0, win32con.KEYEVENTF_KEYUP, 0)
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(win32con.CF_UNICODETEXT, "C:\Program Files (x86)\Kingsoft\kwifi\dbghelp.dll")
date = win32clipboard.GetClipboardData() print(date)
win32clipboard.CloseClipboard() time.sleep(1)
win32api.keybd_event(0x11, 0, 0, 0) win32api.keybd_event(0x56, 0, 0, 0) win32api.keybd_event(0x56, 0, win32con.KEYEVENTF_KEYUP, 0) win32api.keybd_event(0x11, 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(0x0D, 0, 0, 0) win32api.keybd_event(0x0D, 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(0x11, 0, 0, 0) win32api.keybd_event(0x12, 0, 0, 0) win32api.keybd_event(0x71, 0, 0, 0) win32api.keybd_event(0x11, 0, win32con.KEYEVENTF_KEYUP, 0) win32api.keybd_event(0x12, 0, win32con.KEYEVENTF_KEYUP, 0) win32api.keybd_event(0x71, 0, win32con.KEYEVENTF_KEYUP, 0)
|