Re: focused window before clicking

"brucexs-/[email protected] [power-pro]" <[email protected]> 12 Jun 2019 08:19:30 +0000
Newsgroups gmane.comp.windows.power-pro
Message-ID <[email protected]>
I don't think it is possible to use a PPro script reliably recover the last Window clicked before you click on the tray.  The Windows system controls focus and left clicking transfers it to the clicked window.  

 The simplest but still not guaranteed that I can think of is to have an event that runs say every 200 or 500 ms and captures the handle of the current active window and stores that in a global variable.  But do not store it if the mouse if over the systray or the overflow window for hidden icons, if you use hidden tray icons.  Use exec.windowinfo on hotkey to capture the window info you need to make those checks.  If none of that made sense to you, then that would not be the way to go for you.  But if it mostly does make sense except for some specific question, i will try to answer that question.
 

 You could also try experimenting with the windows hooking and mouse hooking stuff available from PPro scripting, but it can make your system unstable in many cases, especially if you try to hook left clicks.  So use at your own risk on that one.