1 2 3 4 5 6 7 8 9 10 11 12 13 |
$code = @" using System; using System.Runtime.InteropServices; public class API { [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); } "@ $t = Add-Type -TypeDefinition $code -PassThru $t::SendMessage(0xffff, 0x0112, 0xf170, 2) |