Пример #1
0
        /// <summary>
        /// Initialize the form
        /// </summary>
        private static void Init()
        {
            // register fake form to Npp
            FakeForm = new EmptyForm();
            NppTbData nppTbData = new NppTbData {
                hClient       = FakeForm.Handle,
                pszName       = AssemblyInfo.AssemblyProduct + " - File explorer",
                dlgID         = DockableCommandIndex,
                uMask         = NppTbMsg.DWS_DF_CONT_LEFT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR,
                hIconTab      = (uint)Utils.GetIconFromImage(ImageResources.FileExplorerLogo).Handle,
                pszModuleName = AssemblyInfo.AssemblyProduct
            };

            IntPtr ptrNppTbData = Marshal.AllocHGlobal(Marshal.SizeOf(nppTbData));

            Marshal.StructureToPtr(nppTbData, ptrNppTbData, false);
            WinApi.SendMessage(Npp.HandleNpp, NppMsg.NPPM_DMMREGASDCKDLG, 0, ptrNppTbData);

            Form = new FileExplorerForm(FakeForm);
        }
Пример #2
0
        /// <summary>
        /// Initialize the form
        /// </summary>
        private static void Init()
        {
            // register fake form to Npp
            FakeForm = new EmptyForm();
            NppTbData nppTbData = new NppTbData {
                hClient = FakeForm.Handle,
                pszName = AssemblyInfo.AssemblyProduct + " - File explorer",
                dlgID = DockableCommandIndex,
                uMask = NppTbMsg.DWS_DF_CONT_LEFT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR,
                hIconTab = (uint) Utils.GetIconFromImage(ImageResources.FileExplorerLogo).Handle,
                pszModuleName = AssemblyInfo.AssemblyProduct
            };

            IntPtr ptrNppTbData = Marshal.AllocHGlobal(Marshal.SizeOf(nppTbData));
            Marshal.StructureToPtr(nppTbData, ptrNppTbData, false);
            WinApi.SendMessage(Npp.HandleNpp, NppMsg.NPPM_DMMREGASDCKDLG, 0, ptrNppTbData);

            Form = new FileExplorerForm(FakeForm);
        }