Ejemplo n.º 1
0
        /// <summary>
        /// Add property page for this object
        /// </summary>
        /// <param name="lpfnAddPage"></param>
        /// <param name="lParam"></param>
        /// <returns></returns>
        int IShellPropSheetExt.AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, IntPtr lParam)
        {
            try
            {
                // ADD PAGES HERE
                SheetControl samplePage;
                PROPSHEETPAGE psp;
                IntPtr hPage;

                // create new inherited property page(s) and pass dobj to it
                samplePage = new DokanNFCSheet();
                psp = samplePage.GetPSP(250, 230);

                hPage = ShellAPIWrapper.CreatePropertySheetPage(ref psp);
                bool result = pfnAddPage(hPage, lParam);
                if (!result)
                {
                    ShellAPIWrapper.DestroyPropertySheetPage(hPage);
                }

                // We'll add reference manualy only if there is no exceptions
                samplePage.KeepAlive();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
            return 0;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add property page for this object
        /// </summary>
        /// <param name="lpfnAddPage"></param>
        /// <param name="lParam"></param>
        /// <returns></returns>
        int IShellPropSheetExt.AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, IntPtr lParam)
        {
            try
            {
                // ADD PAGES HERE
                PropertySheetControl samplePage;
                PROPSHEETPAGE        psp;
                IntPtr hPage;

                // In ActiveDirectory extensions, Get type of object, and show page according to class
                // GetADPath();
                // if(sClass.ToLower() == "organizationalunit") {...}


                // create new inherited property page(s) and pass dobj to it
                samplePage = new DescriptionControl();
                psp        = samplePage.GetPSP(250, 230);



                hPage = Comctl32.CreatePropertySheetPage(ref psp);
                bool result = pfnAddPage(hPage, lParam);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            return(0);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add property page for this object
        /// </summary>
        /// <param name="lpfnAddPage"></param>
        /// <param name="lParam"></param>
        /// <returns></returns>
        int IShellPropSheetExt.AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, IntPtr lParam)
        {
            try
            {
                // ADD PAGES HERE
                SheetControl  samplePage;
                PROPSHEETPAGE psp;
                IntPtr        hPage;

                // create new inherited property page(s) and pass dobj to it
                samplePage = new DokanNFCSheet();
                psp        = samplePage.GetPSP(250, 230);

                hPage = ShellAPIWrapper.CreatePropertySheetPage(ref psp);
                bool result = pfnAddPage(hPage, lParam);
                if (!result)
                {
                    ShellAPIWrapper.DestroyPropertySheetPage(hPage);
                }

                // We'll add reference manualy only if there is no exceptions
                samplePage.KeepAlive();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
            return(0);
        }