Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Win32ShowWindowAsync = Add-Type –memberDefinition @”
- [DllImport("user32.dll")]
- public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
- [DllImport("user32.dll")]
- public static extern bool ShowWindow(IntPtr handle, int state);
- “@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru
- [System.IntPtr] $MainWindowHandle = (Get-Process "*vnc*").MainWindowHandle
- #minimize
- $Win32ShowWindowAsync::ShowWindowAsync($MainWindowHandle, 6)
- Start-Sleep -Seconds 1
- #maximize
- $Win32ShowWindowAsync::ShowWindow($MainWindowHandle, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement