// 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()))); } }
// ------------------------------------------------------ // // 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)); }