I wrote a simple messaging app that I use to send short text messages between computers on my home network. Typically, the window will sit in the background and I send it to the foreground when a message comes in by
def bring_to_front(self):
hwnd = win32gui.FindWindow(None, self.title)
win32gui.ShowWindow(hwnd, win32con.SW_SHOWNORMAL)
win32gui.SetForegroundWindow(hwnd)
The odd thing is that on two nearly identical laptops, both running Windows 11 Home, on one laptop the Window pops to the foreground when a message is received. On the other, the Window stays in the background but the taskbar icon flashes. Any idea why the difference with the same code?