Example #1
0
        /// <summary>
        /// Windows下的鼠标事件
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double WIN_MOUSEEVENT(CVariable var)
        {
            int    dx = 0, dy = 0, data = 0;
            int    vlen    = var.m_parameters.Length;
            String eventID = "";

            if (vlen >= 1)
            {
                eventID = m_indicator.GetText(var.m_parameters[0]);
            }
            if (vlen >= 2)
            {
                dx = (int)m_indicator.GetValue(var.m_parameters[1]);
            }
            if (vlen >= 3)
            {
                dy = (int)m_indicator.GetValue(var.m_parameters[2]);
            }
            if (vlen >= 4)
            {
                data = (int)m_indicator.GetValue(var.m_parameters[3]);
            }
            WinHostEx.MouseEvent(eventID, dx, dy, data);
            return(1);
        }
Example #2
0
        /// <summary>
        /// Windows下获取控件数值
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>数值</returns>
        private double WIN_GETVALUE(CVariable var)
        {
            double value = 0;
            String text  = WinHostEx.GetText();

            value = CStr.ConvertStrToDouble(text);
            return(value);
        }
Example #3
0
        /// <summary>
        /// Windows下的键盘事件
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double WIN_SENDKEY(CVariable var)
        {
            int    vlen = var.m_parameters.Length;
            String key  = "";

            if (vlen >= 1)
            {
                key = m_indicator.GetText(var.m_parameters[0]);
            }
            WinHostEx.SendKey(key);
            return(1);
        }
Example #4
0
        /// <summary>
        /// Windows下的鼠标点击事件
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>

        private double WIN_MOUSECLICK(CVariable var)
        {
            int dx = 0, dy = 0;
            int vlen = var.m_parameters.Length;

            if (vlen >= 1)
            {
                dx = (int)m_indicator.GetValue(var.m_parameters[0]);
            }
            if (vlen >= 2)
            {
                dy = (int)m_indicator.GetValue(var.m_parameters[1]);
            }
            WinHostEx.MouseEvent("SETCURSOR", dx, dy, 0);
            WinHostEx.MouseEvent("LEFTDOWN", 0, 0, 0);
            WinHostEx.MouseEvent("LEFTUP", 0, 0, 0);
            return(1);
        }
Example #5
0
 /// <summary>
 /// Windows下设置文字
 /// </summary>
 /// <param name="var">变量</param>
 /// <returns>状态</returns>
 private double WIN_SETTEXT(CVariable var)
 {
     WinHostEx.SetText(m_indicator.GetText(var.m_parameters[0]));
     return(1);
 }
Example #6
0
 /// <summary>
 /// Windows下执行程序
 /// </summary>
 /// <param name="var">变量</param>
 /// <returns>状态</returns>
 private double WIN_EXECUTE(CVariable var)
 {
     WinHostEx.Execute(m_indicator.GetText(var.m_parameters[0]));
     return(1);
 }