コード例 #1
0
        /// <summary>
        /// The CallbackProc. Called by the shell to inform of key property page events.
        /// </summary>
        /// <param name="hWnd">The h WND.</param>
        /// <param name="uMsg">The u MSG.</param>
        /// <param name="ppsp">The PPSP.</param>
        /// <returns></returns>
        private uint CallbackProc(IntPtr hWnd, PSPCB uMsg, ref PROPSHEETPAGE ppsp)
        {
            switch (uMsg)
            {
            case PSPCB.PSPCB_ADDREF:

                break;

            case PSPCB.PSPCB_RELEASE:

                break;

            case PSPCB.PSPCB_CREATE:

                //  Allow the sheet to be created.
                return(1);
            }
            return(0);
        }
コード例 #2
0
        /// <summary>
        /// Creates the property page handle.
        /// </summary>
        public void CreatePropertyPageHandle(NativeBridge.NativeBridge nativeBridge)
        {
            Logging.Log("Creating property page handle via bridge.");

            //  Create a prop sheet page structure.
            var psp = new PROPSHEETPAGE();

            //  Set the key properties.
            psp.dwSize = (uint)Marshal.SizeOf(psp);
            //psp.dwFlags = PSP.USETITLE | PSP.USECALLBACK/* | PSP.DEFAULT |*/| PSP.DLGINDIRECT;
            //psp.dwFlags = PSP.DEFAULT | PSP.USETITLE | PSP.DLGINDIRECT;
            //psp.hInstance = nativeBridge.GetInstanceHandle();

            psp.hInstance = nativeBridge.GetInstanceHandle();
            psp.dwFlags   = PSP.PSP_DEFAULT | PSP.PSP_USETITLE | PSP.PSP_USECALLBACK;
            Logging.Log("Getting proxy host...");
            psp.pTemplate   = nativeBridge.GetProxyHostTemplate();
            psp.pfnDlgProc  = dialogProc;
            psp.pcRefParent = 0;
            psp.pfnCallback = callbackProc;
            psp.lParam      = IntPtr.Zero;

            //  If we have a title, set it.
            if (!string.IsNullOrEmpty(Target.PageTitle))
            {
                psp.dwFlags |= PSP.PSP_USETITLE;
                psp.pszTitle = Target.PageTitle;
            }

            //  If we have an icon, set it.
            if (Target.PageIcon != null && Target.PageIcon.Handle != IntPtr.Zero)
            {
                psp.dwFlags |= PSP.PSP_USEHICON;
                psp.hIcon    = Target.PageIcon.Handle;
            }

            //  Create a the property sheet page.
            HostWindowHandle = Comctl32.CreatePropertySheetPage(ref psp);

            //  Log the host window handle.
            Logging.Log("Created Proxy Host: " + HostWindowHandle.ToString("X8"));
        }
コード例 #3
0
 public static extern SafePropertySheetPagehandle CreatePropertySheetPage(PROPSHEETPAGE lppsp);