System.Windows.Forms.CommandBar.NotifyNeedTextW C# (CSharp) Method

NotifyNeedTextW() private method

private NotifyNeedTextW ( Message &message ) : void
message Message
return void
        private void NotifyNeedTextW(ref Message message)
        {
            if ((this.Style != CommandBarStyle.Menu) && (Marshal.SystemDefaultCharSize == 2))
            {
                // this code is a duplicate of NotifyNeedTextA
                NativeMethods.TOOLTIPTEXT toolTipText = (NativeMethods.TOOLTIPTEXT) message.GetLParam(typeof(NativeMethods.TOOLTIPTEXT));
                CommandBarItem item = (CommandBarItem) items[toolTipText.hdr.idFrom];
                toolTipText.szText = item.Text;

                CommandBarButtonBase buttonBase = item as CommandBarButton;
                if ((buttonBase != null) && (buttonBase.Shortcut != Keys.None))
                {
                    toolTipText.szText += " (" + TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(null, CultureInfo.InvariantCulture, buttonBase.Shortcut) + ")";
                }

                toolTipText.hinst = IntPtr.Zero;
                if (RightToLeft == RightToLeft.Yes)
                {
                    toolTipText.uFlags |= NativeMethods.TTF_RTLREADING;
                }

                Marshal.StructureToPtr(toolTipText, message.LParam, true);
                message.Result = (IntPtr) 1;
            }
        }