focused window before clicking

"diamantsus-/[email protected] [power-pro]" <[email protected]> 12 Jun 2019 00:57:48 +0000
Newsgroups gmane.comp.windows.power-pro
Message-ID <[email protected]>
When i click a button in systray the active windows loss the focus in favour of systray.
Do it is possible to recover the last active window handle?
i use at the moment:
win.show(win.MainHandleFromPoint(100,100))
but it is not accurate.