Ejemplo n.º 1
0
        // Sets the focus to this item.
        internal override bool SetFocus()
        {
            //
            // Send the link an LM_SETITEM message.
            //
            // Allocate a local LITEM struct.
            UnsafeNativeMethods.LITEM linkItem = new UnsafeNativeMethods.LITEM();

            // Fill in the coordinates about which we care.
            linkItem.mask      = NativeMethods.LIF_ITEMINDEX | NativeMethods.LIF_STATE;
            linkItem.iLink     = _item;
            linkItem.stateMask = NativeMethods.LIS_FOCUSED;
            linkItem.state     = NativeMethods.LIS_FOCUSED;

            unsafe
            {
                // Send the LM_SETITEM message.
                return(XSendMessage.XSend(_hwnd, NativeMethods.LM_SETITEM, IntPtr.Zero, new IntPtr(&linkItem), Marshal.SizeOf(linkItem.GetType())));
            }
        }
Ejemplo n.º 2
0
        // ------------------------------------------------------
        //
        // Private Methods
        //
        // ------------------------------------------------------

        #region Private Methods

        // Copy creator for a link or link item.
        private ProxySimple CreateHyperlinkItem(UnsafeNativeMethods.LITEM linkItem, int index)
        {
            return(new WindowsHyperlinkItem(_hwnd, this, index));
        }