Is there a way I can kill the About window in Rainmeter? I want to show the log when running a powershell script and close it after it's done.
Thanks in advance
-death.crafter
It is currently March 29th, 2024, 11:55 am
Kill About window in Rainmeter
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Kill About window in Rainmeter
from the Realm of Death
-
- Developer
- Posts: 2674
- Joined: November 24th, 2011, 1:42 am
- Location: Utah
Re: Kill About window in Rainmeter
Since you are using powershell, you can do something like this to close a specific dialog window.
This looks for a window titled "About Rainmeter", and sends the WM_CLOSE message to it.
-Brian
Code: Select all
$sig = @'
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(IntPtr sClassName, String sAppName);
[DllImport("User32.dll")]
public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam);
'@
$type = Add-Type -Namespace Win32 -Name Funcs -MemberDefinition $sig -PassThru
$wname='About Rainmeter'
$type::SendMessage($type::FindWindow([IntPtr]::Zero, $wname), 0x0010, 0, 0) # '0x0010' is WM_CLOSE
-Brian
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: Kill About window in Rainmeter
Works like a charm... Thanks a lotBrian wrote: ↑June 10th, 2021, 5:36 am Since you are using powershell, you can do something like this to close a specific dialog window.
This looks for a window titled "About Rainmeter", and sends the WM_CLOSE message to it.Code: Select all
$sig = @' [DllImport("user32.dll", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(IntPtr sClassName, String sAppName); [DllImport("User32.dll")] public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam); '@ $type = Add-Type -Namespace Win32 -Name Funcs -MemberDefinition $sig -PassThru $wname='About Rainmeter' $type::SendMessage($type::FindWindow([IntPtr]::Zero, $wname), 0x0010, 0, 0) # '0x0010' is WM_CLOSE
-Brian
from the Realm of Death