So I want to make an overlay powered by pygame. I managed to get a transparent window by the code below. My only issue now is that when you click or hover on an image the focus switches to the pygame window and thus leaves makes some fps games unplayable. Is there any way to make the window "ignore" events?
Code (snippets):
def get_pygame_window():
return pygame.display.get_wm_info()["window"]
screen = pygame.display.set_mode(self.size, pygame.NOFRAME) # make the window borderless
# make window always top (only works for fake-fullscreen or windowed)
win32gui.SetWindowPos(get_pygame_window(), win32con.HWND_TOPMOST, 0, 0, 0, 0, win32con.SWP_NOSIZE | win32con.SWP_NOMOVE)
hwnd = get_pygame_window()
win32gui.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, win32gui.GetWindowLong(hwnd,win32con.GWL_EXSTYLE) | win32con.WS_EX_LAYERED)
# Set window transparency color (windows keys this out so it becomes transparent)
win32gui.SetLayeredWindowAttributes(hwnd, win32api.RGB(*get_clear_color()), 0, win32con.LWA_COLORKEY)