It is currently March 28th, 2024, 11:08 pm

Looking for a plugin that will tell me which program has focus

Share and get help with Plugins and Addons
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Looking for a plugin that will tell me which program has focus

Post by Virginityrocks »

I'm looking for a plugin that will tell me which program has focus. So that, for example, if I have Chrome focused, the plugin will return "Chrome".

I'm also looking for a plugin that will change focus to that window on keypress.

And a plugin that can send keystrokes. For example, if Chrome has focus, a set of options pertaining to Chrome appear in Rainmeter. Those options may be "Open a new window" "Incognito Mode", etc.

When the options are pressed, the plugin changes focus to that window, then sends the required keystrokes for each action.

Example: Select option "Open New Window" ---- Change focus to Chrome ---- Send keystroke CTRL+N.
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Looking for a plugin that will tell me which program has focus

Post by StArL0rd84 »

Dunno if there is a way to tell wich program has focus, but
you can program hotkeys using 'SendKey' from Santa Ryan's Toolkit.
https://forum.rainmeter.net/viewtopic.php?f=18&t=7592

And you can use NirCMD to focus, minimize, maximize and close apps:
http://www.nirsoft.net/utils/nircmd.html

Code: Select all

Variables
NirCMD=#@#exe\NirCMD\nircmd-x64.exe

Focus:
LeftMouseUpAction=[#nircmd# win activate Chrome.exe]

Minimize:
LeftMouseUpAction=[#nircmd# win togglemin Chrome.exe]

Maximize:
LeftMouseUpAction=[#nircmd# win togglemax nChrome.exe]

Close:
LeftMouseUpAction=[#nircmd# win closeprocess Chrome.exe]
or
[#nircmd# killprocess Chrome.exe]]
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Looking for a plugin that will tell me which program has focus

Post by eclectic-tech »

Virginityrocks wrote:I'm looking for a plugin that will tell me which program has focus. So that, for example, if I have Chrome focused, the plugin will return "Chrome".
Have you looked at QuickBang? It can track which program is active (focused) and do way too many other things! 8-)

For the other parts, I believe StArL0rd84 provided the best answers available right now. :(