public void Dispose() { WindowerHelper.DeleteConsoleHelper(_ConsoleHelper); WindowerHelper.DeleteTextHelper(_TextHelper); WindowerHelper.DeleteKeyboardHelper(_KeyboardHelper); _Pid = 0; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="pid">対象プロセスID</param> public Windower(int pid) { _Pid = pid; _ConsoleHelper = WindowerHelper.CreateConsoleHelper("WindowerMMFConsoleHandler_" + pid.ToString()); _TextHelper = WindowerHelper.CreateTextHelper("WindowerMMFTextHandler_" + pid.ToString()); _KeyboardHelper = WindowerHelper.CreateKeyboardHelper("WindowerMMFKeyboardHandler_" + pid.ToString()); }
/// <summary> /// コンソールコマンドの文字列を取得 /// </summary> /// <param name="index">argc index</param> /// <returns>文字列</returns> public string ConsoleGetArg(short index) { byte[] buffer = new byte[256]; // いまのところ256バイトのみ // text = String.Format("{0:255}", " "); WindowerHelper.CCHGetArg(_ConsoleHelper, index, buffer); var len = 0; for (var i = 0; i < buffer.Length; i++) { if (buffer[i] == 0) { len = i; break; } } return(Encoding.Default.GetString(buffer, 0, len)); }
/// <summary> /// キー押下を送信 /// </summary> /// <param name="code">KeyCode</param> /// <param name="down">true: down, false: up</param> public void KeyDown(Key code, bool down) { WindowerHelper.CKHSetKey(_KeyboardHelper, Convert.ToByte(code), down); }
/// <summary> /// FFXIチャットラインへテキストを送信 (コマンド可) /// </summary> /// <param name="text">テキスト</param> public void SendText(string text) { WindowerHelper.CKHSendString(_KeyboardHelper, text); }
public void Flush() { WindowerHelper.CTHFlushCommands(_Parent.TextHelper); }
public void Dispose() { WindowerHelper.CTHDeleteTextObject(_Parent.TextHelper, _Name); Flush(); }
public void SetVisibility(bool visible) { WindowerHelper.CTHSetVisibility(_Parent.TextHelper, _Name, visible); }
public void SetFontColor(byte Alpha, byte Red, byte Green, byte Blue) { WindowerHelper.CTHSetColor(_Parent.TextHelper, _Name, Alpha, Red, Green, Blue); }
public void SetItalic(bool italic) { WindowerHelper.CTHSetItalic(_Parent.TextHelper, _Name, italic); }
public void SetBold(bool bold) { WindowerHelper.CTHSetBold(_Parent.TextHelper, _Name, bold); }
public void SetLocation(float x, float y) { WindowerHelper.CTHSetLocation(_Parent.TextHelper, _Name, x, y); }
public void SetText(string text) { WindowerHelper.CTHSetText(_Parent.TextHelper, _Name, text); }
public TextObject(Windower w, string name) { _Parent = w; _Name = name; WindowerHelper.CTHCreateTextObject(w.TextHelper, name); }
/// <summary> /// コンソールコマンドの引数の数を取得 /// </summary> /// <returns></returns> public int ConsoleGetArgCount() { return(WindowerHelper.CCHGetArgCount(_ConsoleHelper)); }
/// <summary> /// キーストロークを送信 /// </summary> /// <param name="code">キーコード</param> public void SendKey(Key code) { WindowerHelper.CKHSetKey(_KeyboardHelper, Convert.ToByte(code), true); Thread.Sleep(KeyPressDelay); WindowerHelper.CKHSetKey(_KeyboardHelper, Convert.ToByte(code), false); }