INNER CODE UNIT · Python

get_all_windows

Qwejay/Qflow · main.py:335

    def get_all_windows():
        results = []
        pid_map = WindowEngine._get_process_map()
        my_pid = os.getpid()
        def callback(hwnd, extra):
            if WindowEngine.is_window_valid_target(hwnd, my_pid):
                info = WindowEngine.get_window_info(hwnd, pid_map)
                if info:
                    info['rect'] = WindowEngine.get_window_rect(hwnd)
                    if info['rect']: results.append(info)
            return True
        WNDENUMPROC = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.c_int, ctypes.c_int)
        user32.EnumWindows(WNDENUMPROC(callback), 0)
        return results

    @staticmethod
    def get_top_window_at_mouse():
        class POINT(ctypes.Structure): _fields_ = [("x", ctypes.c_long), ("y", ctypes.c_long)]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…