Ejemplo n.º 1
0
        private void OnLoadHandler(object sender, EventArgs e)
        {
            ulong ulFlags = 2;

            try
            {
                if (WMTouchForm.RegisterTouchWindow(this.Handle, ulFlags))
                {
                    return;
                }
                Logger.Info("Touch: ERROR: Could not register window for touch");
            }
            catch (Exception ex)
            {
                Logger.Info("Touch: ERROR: RegisterTouchWindow API not available");
                Logger.Info("Touch: " + ex.ToString());
            }
        }
Ejemplo n.º 2
0
        private bool DecodeTouch(ref Message m)
        {
            if (this.TouchEvent == null)
            {
                return(false);
            }
            int cInputs = WMTouchForm.LoWord(m.WParam.ToInt32());

            if (cInputs > this.touchInputArray.Length)
            {
                cInputs = this.touchInputArray.Length;
            }
            if (!WMTouchForm.GetTouchInputInfo(m.LParam, cInputs, this.touchInputArray, this.touchInputSize))
            {
                return(false);
            }
            for (int index = 0; index < this.touchPointArray.Length; ++index)
            {
                this.touchPointArray[index].Clear();
            }
            for (int index = 0; index < cInputs; ++index)
            {
                WMTouchForm.TOUCHINPUT touchInput = this.touchInputArray[index];
                WMTouchForm.TouchPoint touchPoint = this.touchPointArray[index];
                if ((touchInput.dwFlags & 2) != 0 || (touchInput.dwFlags & 1) != 0)
                {
                    Point client = this.PointToClient(new Point(touchInput.x / 100, touchInput.y / 100));
                    touchPoint.Id = touchInput.dwID;
                    touchPoint.X  = client.X;
                    touchPoint.Y  = client.Y;
                }
            }
            this.TouchEvent((object)this, this.touchEventArgs);
            WMTouchForm.CloseTouchInputHandle(m.LParam);
            return(true);
        }
Ejemplo n.º 3
0
 public WMTouchEventArgs(WMTouchForm form)
 {
     this.form = form;
 }