def set_windows_os_screenshot_protection_drm_flag(window: QWidget) -> None:
    """
    sets the windows WDA_MONITOR flag on the window so windows prevents capturing
    screenshots and microsoft recall will not be able to record the window
    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity
    """
    if sys.platform not in ('win32', 'windows'):
        return
    try:
        window_id = int(window.winId())
        WDA_MONITOR = 0x01
        ctypes.windll.user32.SetWindowDisplayAffinity(window_id, WDA_MONITOR)
    except Exception:
        _logger.exception(f"failed to set windows screenshot protection flag")

    sets the windows WDA_MONITOR flag on the window so windows prevents capturing
    screenshots and microsoft recall will not be able to record the window
    https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity
    
electrum/gui/qt/util.py