protected override void DoShowCursor(bool show)
 {
     if (isVideoAvailable && videoWindow != null)
     {
         int hidden = (show) ? (int)OABool.False : (int)OABool.True;
         int hr     = videoWindow.HideCursor(hidden);
         DsError.ThrowExceptionForHR(hr);
     }
 }
Ejemplo n.º 2
0
        ////////////////
        /// IsCursorHidden/HideCursor
        private void TestCursor()
        {
            int    hr;
            OABool HideCursor1, HideCursor2;

            // Read the current value
            hr = m_ivw.IsCursorHidden(out HideCursor1);
            Marshal.ThrowExceptionForHR(hr);

            // Change it
            hr = m_ivw.HideCursor(~HideCursor1);
            Marshal.ThrowExceptionForHR(hr);

            // Re-read
            hr = m_ivw.IsCursorHidden(out HideCursor2);
            Marshal.ThrowExceptionForHR(hr);

            // Make sure the value we set is what we just read
            Debug.Assert(HideCursor1 != HideCursor2, "IsCursorHidden/HideCursor");

            // Try it the other way

            // Read the current value
            hr = m_ivw.IsCursorHidden(out HideCursor1);
            Marshal.ThrowExceptionForHR(hr);

            // Change it
            hr = m_ivw.HideCursor(~HideCursor1);
            Marshal.ThrowExceptionForHR(hr);

            // Re-read
            hr = m_ivw.IsCursorHidden(out HideCursor2);
            Marshal.ThrowExceptionForHR(hr);

            // Make sure the value we set is what we just read
            Debug.Assert(HideCursor1 != HideCursor2, "IsCursorHidden/HideCursor");
        }