/// <summary>指定したウィンドウのテキストを取得する</summary> public static string GetText(IntPtr windowHandle) { var byteLength = WindowController2.SendMessage(windowHandle, WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero).ToInt32(); var buff = new StringBuilder(byteLength + 1); WindowController2.SendMessage(windowHandle, WM_GETTEXT, byteLength + 1, buff); return(buff.ToString()); }
/// <summary>指定したウィンドウにコマンドを送る</summary> public static void SendCommand(IntPtr windowHandle, int command) { WindowController2.SendMessage(windowHandle, WM_COMMAND, new IntPtr(command), IntPtr.Zero); }