diff --git a/scripts/focus_control.ps1 b/scripts/focus_control.ps1 new file mode 100644 index 0000000..8b74322 --- /dev/null +++ b/scripts/focus_control.ps1 @@ -0,0 +1,16 @@ +Add-Type @" + using System; + using System.Runtime.InteropServices; + public class User32 { + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetForegroundWindow(IntPtr hWnd); + } +"@ + +$process = Get-Process | Where-Object { $_.MainWindowTitle -like "*Bezos Loves Slides*" } +Write-Host $process.MainWindowTitle + +if ($process) { + [User32]::SetForegroundWindow($process.MainWindowHandle) +}