Beispiel #1
0
        /// <include file='doc\Help.uex' path='docs/doc[@for="Help.ShowPopup"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Displays a Help pop-up window.
        ///    </para>
        /// </devdoc>
        public static void ShowPopup(Control parent, string caption, Point location)
        {
            Debug.WriteLineIf(Help.WindowsFormsHelpTrace.TraceVerbose, "Help:: ShowPopup");

            NativeMethods.HH_POPUP pop = new NativeMethods.HH_POPUP();

            // We have to marshal the string ourselves to prevent access violations.
            IntPtr pszText = Marshal.StringToCoTaskMemAuto(caption);

            try {
                pop.pszText  = pszText;
                pop.idString = 0;
                pop.pt       = new NativeMethods.POINT(location.X, location.Y);

                // Looks like a windows


                pop.clrBackground = Color.FromKnownColor(KnownColor.Window).ToArgb() & 0x00ffffff;

                ShowHTML10Help(parent, null, HelpNavigator.Topic, pop);
            }
            finally {
                Marshal.FreeCoTaskMem(pszText);
            }
        }
 public static extern int HtmlHelp(HandleRef hwndCaller, [MarshalAs(UnmanagedType.LPTStr)] string pszFile, int uCommand, [MarshalAs(UnmanagedType.LPStruct)] NativeMethods.HH_POPUP dwData);