Skip to content

Instantly share code, notes, and snippets.

@rkttu
Created June 16, 2022 06:18
Show Gist options
  • Select an option

  • Save rkttu/1ffe6aeb9208ac25750cb9816f514469 to your computer and use it in GitHub Desktop.

Select an option

Save rkttu/1ffe6aeb9208ac25750cb9816f514469 to your computer and use it in GitHub Desktop.
Meet Internet Explorer Again 😏
Add-Type 'public class SFW { [System.Runtime.InteropServices.DllImport("user32.dll")][return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)] public static extern System.Boolean SetForegroundWindow(System.IntPtr hWnd); }'
$handle = [activator]::CreateInstance([type]::GetTypeFromCLSID("0002DF01-0000-0000-C000-000000000046"))
$handle.Visible = $true
$handle.Navigate('http://www.example.com/')
[SFW]::SetForegroundWindow($handle.HWND)
@sople1
Copy link
Copy Markdown

sople1 commented Jun 16, 2022

image
(Windows 11)

WTF...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment