It is currently March 29th, 2024, 1:48 pm

How do I bring an app's window into focus?

Get help with creating, editing & fixing problems with skins
FinnBot5000
Posts: 2
Joined: November 29th, 2021, 12:17 am

How do I bring an app's window into focus?

Post by FinnBot5000 »

I am trying to open an app if it is closed, and if it is already open, bring it into focus by clicking a button in my rainmeter skin. I am very new to this, and have figured out how to open an app, but cant find a way to focus a window. Just opening an already open app doesnt do it.

P.S. Is there any way to move/resize windows when i click the button?
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: How do I bring an app's window into focus?

Post by death.crafter »

FinnBot5000 wrote: November 29th, 2021, 12:23 am I am trying to open an app if it is closed, and if it is already open, bring it into focus by clicking a button in my rainmeter skin. I am very new to this, and have figured out how to open an app, but cant find a way to focus a window. Just opening an already open app doesnt do it.

P.S. Is there any way to move/resize windows when i click the button?
I dont think you can do it from Rainmeter natively, but you can from PowerShell using after importing a few functions from win32.dll.

And I am assuming you are familiar with PowerShell. Even if not, you can search for them in Google. And you can then use RunCommand plugin.

If you can't do it then let me know and I will look into it when I get some time.
from the Realm of Death
FinnBot5000
Posts: 2
Joined: November 29th, 2021, 12:17 am

Re: How do I bring an app's window into focus?

Post by FinnBot5000 »

Ok, thank you for the help. I am not sure how to do the commands, but I will figure it out. I will let you know if/when I get it working.