Beispiel #1
0
 public void Dispose()
 {
     WindowerHelper.DeleteConsoleHelper(_ConsoleHelper);
     WindowerHelper.DeleteTextHelper(_TextHelper);
     WindowerHelper.DeleteKeyboardHelper(_KeyboardHelper);
     _Pid = 0;
 }
Beispiel #2
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());
        }
Beispiel #3
0
        /// <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));
        }
Beispiel #4
0
 /// <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);
 }
Beispiel #5
0
 /// <summary>
 /// FFXIチャットラインへテキストを送信 (コマンド可)
 /// </summary>
 /// <param name="text">テキスト</param>
 public void SendText(string text)
 {
     WindowerHelper.CKHSendString(_KeyboardHelper, text);
 }
Beispiel #6
0
 public void Flush()
 {
     WindowerHelper.CTHFlushCommands(_Parent.TextHelper);
 }
Beispiel #7
0
 public void Dispose()
 {
     WindowerHelper.CTHDeleteTextObject(_Parent.TextHelper, _Name);
     Flush();
 }
Beispiel #8
0
 public void SetVisibility(bool visible)
 {
     WindowerHelper.CTHSetVisibility(_Parent.TextHelper, _Name, visible);
 }
Beispiel #9
0
 public void SetFontColor(byte Alpha, byte Red, byte Green, byte Blue)
 {
     WindowerHelper.CTHSetColor(_Parent.TextHelper, _Name, Alpha, Red, Green, Blue);
 }
Beispiel #10
0
 public void SetItalic(bool italic)
 {
     WindowerHelper.CTHSetItalic(_Parent.TextHelper, _Name, italic);
 }
Beispiel #11
0
 public void SetBold(bool bold)
 {
     WindowerHelper.CTHSetBold(_Parent.TextHelper, _Name, bold);
 }
Beispiel #12
0
 public void SetLocation(float x, float y)
 {
     WindowerHelper.CTHSetLocation(_Parent.TextHelper, _Name, x, y);
 }
Beispiel #13
0
 public void SetText(string text)
 {
     WindowerHelper.CTHSetText(_Parent.TextHelper, _Name, text);
 }
Beispiel #14
0
 public TextObject(Windower w, string name)
 {
     _Parent = w;
     _Name   = name;
     WindowerHelper.CTHCreateTextObject(w.TextHelper, name);
 }
Beispiel #15
0
 /// <summary>
 /// コンソールコマンドの引数の数を取得
 /// </summary>
 /// <returns></returns>
 public int ConsoleGetArgCount()
 {
     return(WindowerHelper.CCHGetArgCount(_ConsoleHelper));
 }
Beispiel #16
0
 /// <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);
 }