コード例 #1
0
        private void button_SendNullStr_Click(object sender, EventArgs e)
        {
            IntPtr            handle = (IntPtr)Convert.ToInt32(this.textBox_OutputHandle.Text, 16);
            McOutPutWndHooker hooker = new McOutPutWndHooker(handle);

            hooker.SendMessageToOutPutWnd("");

            if (m_looper == null)
            {
                m_looper = new MCDataLooper(handle);
            }
        }
コード例 #2
0
        private void button_GetOutPutContent_Click(object sender, EventArgs e)
        {
            try
            {
                IntPtr            handle = (IntPtr)Convert.ToInt32(this.textBox_OutputHandle.Text, 16);
                McOutPutWndHooker hooker = new McOutPutWndHooker(handle);
                string            result = hooker.SendMessageToHoldOutPutMessage();

                if (m_looper == null)
                {
                    m_looper = new MCDataLooper(handle);
                }

                this.richTextBox_TradeInfo.Clear();
                m_notifyBindList.Clear();

                //转换成List然后对于收到的Print进行分类
                List <string> strInfoList = result.Split(new char[] { '\r', '\n' }).ToList();

                List <string> newStrinfoList = new List <string>();

                foreach (string str in strInfoList)
                {
                    if (str != "")
                    {
                        newStrinfoList.Add(str);
                    }
                }

                foreach (string strInfo in newStrinfoList)
                {
                    if (strInfo.Contains("NOTIFY"))
                    {
                        NotifyAppendTextRich(strInfo);
                    }
                    else
                    {
                        SingleAppendTextRich(strInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取内容分类或者超出获取的索引范围,检查...");
                return;
            }
        }