Create a gist now

Instantly share code, notes, and snippets.

@gioxx /ShowReminder.ps1 Secret
Created Apr 12, 2017

What would you like to do?
Genera una MessageBox (Visual Basic) per mostrare a video un testo di "promemoria".
param (
Add-Type -AssemblyName Microsoft.VisualBasic
$showWindowAsync = Add-Type –memberDefinition @”
public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
“@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru
function Show-PowerShell() { [void]$showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 10) }
function Hide-PowerShell() { [void]$showWindowAsync::ShowWindowAsync((Get-Process –id $pid).MainWindowHandle, 2) }
$MsgBox = [Microsoft.VisualBasic.Interaction]
[void] $MsgBox::MsgBox($MsgText,0,$MsgTitle)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment