It is currently June 16th, 2021, 9:51 am

Kill About window in Rainmeter

Get help with installing and using Rainmeter.
User avatar
death.crafter
Posts: 174
Joined: April 24th, 2021, 8:13 pm

Kill About window in Rainmeter

Post by death.crafter »

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
from the Realm of Death
User avatar
Brian
Developer
Posts: 2140
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Kill About window in Rainmeter

Post by Brian »

Since you are using powershell, you can do something like this to close a specific dialog window.

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
This looks for a window titled "About Rainmeter", and sends the WM_CLOSE message to it.

-Brian
User avatar
death.crafter
Posts: 174
Joined: April 24th, 2021, 8:13 pm

Re: Kill About window in Rainmeter

Post by death.crafter »

Brian wrote: June 10th, 2021, 5:36 am Since you are using powershell, you can do something like this to close a specific dialog window.

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
This looks for a window titled "About Rainmeter", and sends the WM_CLOSE message to it.

-Brian
Works like a charm... Thanks a lot :D
from the Realm of Death