Beispiel #1
0
 public void Close()
 {
     if (m_hCTX != IntPtr.Zero)
     {
         WinTab.WTClose(m_hCTX);
         m_hCTX = IntPtr.Zero;
     }
     else
     {
         throw new Exception("Context is not initialized.");
     }
 }
Beispiel #2
0
        public unsafe WinTabContext Open(IntPtr hWnd, bool bEnable)
        {
            fixed(LOGCONTEXT *p = &m_srLogContext)
            {
                WinTab.WTInfo(InfoCategory.DEFCONTEXT, 0, p);

                m_srLogContext.lcOptions = ContextOption.MESSAGES | ContextOption.SYSTEM | ContextOption.CSRMESSAGES;
                m_srLogContext.lcPktData = WinTab.WTPKT_ALL_WITHOUT_XY;
                m_srLogContext.lcPktMode = WTPKT.BUTTONS;
                m_srLogContext.lcSysMode = 0;

                m_hCTX = WinTab.WTOpen(hWnd, p, Convert.ToInt32(bEnable));
            }

            m_bEnabled = bEnable;
            return(this);
        }
Beispiel #3
0
        protected override void WndProc(ref Message eventMsg)
        {
            // Listen for operating system messages
            //parent.testTextBox.AppendText("msg: " + eventMsg + "\n");

            switch (eventMsg.Msg)
            {
            case WM_ACTIVATE:
            {
                HCTX hCtx = parent.HLogContext;

                if (hCtx > 0)
                {
                    Int32 activateState = eventMsg.WParam.ToInt32() & 0xFFFF;

                    CWintabFuncs.WTEnable(parent.HLogContext, (activateState > 0));

                    if (activateState > 0)
                    {
                        CWintabFuncs.WTOverlap(hCtx, true);
                    }
                }
            }
            break;

            case (int)WintabEventMessage.WT_PACKET:
            {
                // Notify the parent form that a data packet was received.
                UInt32 pktSerialNum = (UInt32)eventMsg.WParam;
                UInt32 hContext     = (UInt32)eventMsg.LParam;

                parent.HandleEvent_WT_PACKET(hContext, pktSerialNum);
            }
            break;

            default:
                base.WndProc(ref eventMsg);
                break;
            }
        }
Beispiel #4
0
 public WinTabContext(HCTX i)
 {
     m_hCTX = i;
 }
Beispiel #5
0
 public WinTabContext()
 {
     m_hCTX = IntPtr.Zero;
 }