コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: CWintabContext.cs プロジェクト: vvvv/WintabDN
        /// <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);
        }
コード例 #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);
        }
コード例 #5
0
ファイル: CWintabContext.cs プロジェクト: niallb/DTTPresent
        /// <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);
        }
コード例 #6
0
ファイル: CWintabFuncs.cs プロジェクト: Bgoon/GKit
 public static extern P_HCTX WTOpen(P_HWND hWnd_I, ref WintabLogContext logContext_I, bool enable_I);
コード例 #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;
        }
コード例 #8
0
 public static extern P_HCTX WTOpenA(P_HWND hWnd_I, ref WintabLogContext logContext_I, bool enable_I);