INNER CODE UNIT · Python

is_window_valid_target

Qwejay/Qflow · main.py:312

    def is_window_valid_target(hwnd, my_pid):
        if not user32.IsWindowVisible(hwnd): return False
        if user32.IsIconic(hwnd): return False
        if user32.GetWindow(hwnd, 4) != 0: return False
        is_cloaked = ctypes.c_int(0)
        ctypes.windll.dwmapi.DwmGetWindowAttribute(hwnd, 14, ctypes.byref(is_cloaked), ctypes.sizeof(is_cloaked))
        if is_cloaked.value != 0: return False
        pid = ctypes.c_ulong()
        user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))
        if pid.value == my_pid: return False
        cls_buff = ctypes.create_unicode_buffer(256)
        user32.GetClassNameW(hwnd, cls_buff, 256)
        cls_name = cls_buff.value
        if cls_name in ['Progman', 'Shell_TrayWnd', 'Button', 'Static', 'WorkerW', 'Windows.UI.Core.CoreWindow', 'EdgeUiInputTopWnd', 'ApplicationFrameWindow']: return False
        rect = ctypes.wintypes.RECT()
        user32.GetWindowRect(hwnd, ctypes.byref(rect))
        w, h = rect.right - rect.left, rect.bottom - rect.top
        if w < 10 or h < 10: return False 

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…