Beispiel #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);
        }
Beispiel #2
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);
        }