I know it can be done through StealFocus.exe but it would be good if we could directly bring a skin to focus. So that we can use OnUnfocusAction without having to click the skin.
This doesn't need more explanation I guess. Can this be done?
Possible bang: [!Focus] or [!Focus "config"]
It is currently March 28th, 2024, 9:55 am
[Suggestion]!Focus bang
- death.crafter
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
- Contact:
Re: [Suggestion]!Focus bang
This has been discussed before.
https://forum.rainmeter.net/viewtopic.php?f=14&t=32520&p=162993&hilit=focus#p162993
-Brian
https://forum.rainmeter.net/viewtopic.php?f=14&t=32520&p=162993&hilit=focus#p162993
-Brian
- death.crafter
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
- Contact:
Re: [Suggestion]!Focus bang
Ohh I see.Brian wrote: ↑July 21st, 2021, 9:18 pm This has been discussed before.
https://forum.rainmeter.net/viewtopic.php?f=14&t=32520&p=162993&hilit=focus#p162993
-Brian
Btw, do you have any idea about which win32 api function is used to bring focus to skins? I tried to use SetFocus() and SetForegroundWindow() but they didn't work. Well, SetFocus() didn't work with Notepad either. But it returned the handles all right(the previous one in focus or foreground).
Here is the code I tried to use:
Code: Select all
param (
[Parameter(mandatory)]
$processTitle
)
$winApi = '
[DllImport("user32.dll")] public static extern int SetForegroundWindow(IntPtr hwnd);
'
$type = Add-Type -MemberDefinition $winApi -Name WindowAPI -PassThru
$hwnd = (Get-Process | Where MainWindowTitle -eq $processTitle | Select MainWindowHandle).MainWindowHandle
$type::SetForegroundWindow($hwnd)
Thanks in advance.
- death.crafter
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
- Contact:
Re: [Suggestion]!Focus bang
Okay the ps1 above works.
- Active Colors
- Moderator
- Posts: 1251
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
- Contact:
Re: [Suggestion]!Focus bang
Have you got your hands on trying this? https://forum.rainmeter.net/viewtopic.php?f=128&t=22839
- death.crafter
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
- Contact:
Re: [Suggestion]!Focus bang
https://forum.rainmeter.net/viewtopic.php?f=128&p=194050#p194050Active Colors wrote: ↑July 23rd, 2021, 7:31 am Have you got your hands on trying this? https://forum.rainmeter.net/viewtopic.php?f=128&t=22839
- Active Colors
- Moderator
- Posts: 1251
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
- Contact:
Re: [Suggestion]!Focus bang
This doesn't answer my question because "The requested topic does not exist" :ddeath.crafter wrote: ↑July 23rd, 2021, 6:04 pm https://forum.rainmeter.net/viewtopic.php?f=128&p=194050#p194050
- death.crafter
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
- Contact:
Re: [Suggestion]!Focus bang
https://forum.rainmeter.net/viewtopic.php?f=128&p=194080#p194080Active Colors wrote: ↑July 23rd, 2021, 8:25 pm This doesn't answer my question because "The requested topic does not exist" :d
Sorry, I had that post removed because the plugin was faulty.