import ctypes, win32gui
from ctypes import wintypes

user32 = ctypes.windll.user32
hdesk = user32.OpenInputDesktop(0, False, 0x01FF)
if hdesk: user32.SetThreadDesktop(hdesk)

hwnds = []
def cb(h, _):
    txt_len = user32.GetWindowTextLengthW(h) + 1
    txt_buf = ctypes.create_unicode_buffer(txt_len)
    user32.GetWindowTextW(h, txt_buf, txt_len)
    if 'JXHelper' in txt_buf.value and user32.IsWindowVisible(h):
        hwnds.append(h)
    return True
user32.EnumWindows(ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)(cb), 0)
main_hwnd = hwnds[0]

def child_cb(h, _):
    cls = win32gui.GetClassName(h)
    txt = win32gui.GetWindowText(h)
    r = win32gui.GetWindowRect(h)
    mr = win32gui.GetWindowRect(main_hwnd)
    rel = (r[0]-mr[0], r[1]-mr[1], r[2]-r[0], r[3]-r[1])
    print(f'{hex(h)}: {cls} | rel={rel} | Text: "{txt}"')
    return True
user32.EnumChildWindows(main_hwnd, ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)(child_cb), 0)
