/// <summary>
        /// Returns a list of indecies of previous or currently attached devices.
        /// It is up to the caller to use the list to determine which devices are
        /// actually physically device by responding to data events for those devices.
        /// Devices that are not physically attached will, of course, never send
        /// a data event.
        /// </summary>
        /// <returns></returns>
        public static List <Byte> GetFoundDevicesIndexList()
        {
            List <Byte> list = new List <Byte>();

            try
            {
                WintabLogContext ctx = new WintabLogContext();
                IntPtr           buf = CMemUtils.AllocUnmanagedBuf(ctx);

                for (Int32 idx = 0; idx < MAX_NUM_ATTACHED_TABLETS; idx++)
                {
                    int size = (int)CWintabFuncs.WTInfoA(
                        (UInt32)(EWTICategoryIndex.WTI_DDCTXS + idx), 0, buf);
                    if (size == 0)
                    {
                        break;
                    }
                    else
                    {
                        list.Add((Byte)idx);
                    }
                }

                CMemUtils.FreeUnmanagedBuf(buf);
            }
            catch (Exception ex)
            {
                MessageBox.Show("FAILED GetNumberOfConfiguredDevices: " + ex.ToString());
            }

            return(list);
        }
        /// <summary>
        /// Return the number of tablets that have at some time been attached.
        /// A record of these devices is in the tablet settings.  Since there
        /// is no direct query for this value, we have to enumerate all of
        /// the tablet settings.
        /// </summary>
        /// <returns>tablet count</returns>
        public static UInt32 GetNumberOfConfiguredDevices()
        {
            UInt32 numConfiguredTablets = 0;

            try
            {
                WintabLogContext ctx = new WintabLogContext();
                IntPtr           buf = CMemUtils.AllocUnmanagedBuf(ctx);

                for (Int32 idx = 0; idx < MAX_NUM_ATTACHED_TABLETS; idx++)
                {
                    int size = (int)CWintabFuncs.WTInfoA(
                        (UInt32)(EWTICategoryIndex.WTI_DDCTXS + idx), 0, buf);
                    if (size == 0)
                    {
                        break;
                    }
                    else
                    {
                        numConfiguredTablets++;
                    }
                }

                CMemUtils.FreeUnmanagedBuf(buf);
            }
            catch (Exception ex)
            {
                MessageBox.Show("FAILED GetNumberOfConfiguredDevices: " + ex.ToString());
            }

            return(numConfiguredTablets);
        }
Esempio n. 3
0
        /// <summary>
        /// Close the context for this object.
        /// </summary>
        /// <returns>true if context successfully closed</returns>
        public bool Close()
        {
            bool status = false;

            if (!m_hCTX.IsValid)
            {
                throw new Exception("CloseContext: invalid context");
            }

            status       = CWintabFuncs.WTClose(m_hCTX);
            m_hCTX       = HCTX.Zero;
            m_logContext = new WintabLogContext();

            return(status);
        }
Esempio n. 4
0
        /// <summary>
        /// Close the context for this object.
        ///
        /// </summary>
        /// <returns>true if context successfully closed</returns>
        public bool Close()
        {
            bool status = false;

            try {
                if (!m_hCTX.IsValid)
                {
                    throw new Exception("CloseContext: invalid context");
                }

                status       = WNativeMethods.WTClose(m_hCTX);
                m_hCTX       = HCTX.Zero;
                m_logContext = new WintabLogContext();
                WMessageEvents.Close();
            } catch (Exception ex) {
                throw new Exception("FAILED CloseContext: " + ex.ToString());
            }

            return(status);
        }
Esempio n. 5
0
        /// <summary>
        /// Close the context for this object.
        /// </summary>
        /// <returns>true if context successfully closed</returns>
        public bool Close()
        {
            bool status = false;

            try
            {
                if (m_hCTX == 0)
                {
                    throw new Exception("CloseContext: invalid context");
                }

                status       = CWintabFuncs.WTClose(m_hCTX);
                m_hCTX       = 0;
                m_logContext = new WintabLogContext();
            }
            catch (Exception ex)
            {
                MessageBox.Show("FAILED CloseContext: " + ex.ToString());
            }

            return(status);
        }
Esempio n. 6
0
 public static extern P_HCTX WTOpen(P_HWND hWnd_I, ref WintabLogContext logContext_I, bool enable_I);
Esempio n. 7
0
        /// <summary>
        /// Close the context for this object.
        /// </summary>
        /// <returns>true if context successfully closed</returns>
        public bool Close()
        {
            bool status = false;

            try
            {
                if (m_hCTX == 0)
                {
                    throw new Exception("CloseContext: invalid context");
                }

                status = CWintabFuncs.WTClose(m_hCTX);
                m_hCTX = 0;
                m_logContext = new WintabLogContext();
            }
            catch (Exception ex)
            {
                MessageBox.Show("FAILED CloseContext: " + ex.ToString());
            }

            return status;
        }
 public static extern P_HCTX WTOpenA(P_HWND hWnd_I, ref WintabLogContext logContext_I, bool enable_I);