I am developing an application that is in the system tray and can perform actions in the active window. But when the icon in the system tray is clicked, it GetForegroundWindow()returns the taskbar. I need to get a window that was active before the taskbar.
I tried to list the desktop window with EnumWindowsand GetWindow, but this often leads to the fact that gadgets for desktop computers and other top items are inactive. Is this possible, or is information completely lost when the window is deactivated?
source
share