Community
    • Login

    Not able to set dock position at the bottom of notepad++

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    4 Posts 2 Posters 2.8k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sridhar elangovanS Offline
      sridhar elangovan
      last edited by

      internal static void myDockableDialog()
      {
      if (MpsQcTool == null)
      {
      MpsQcTool = new QC_Tool_Dll.MpsQcTool();

                  using (Bitmap newBmp = new Bitmap(16, 16))
                  {
                      Graphics g = Graphics.FromImage(newBmp);
                      ColorMap[] colorMap = new ColorMap[1];
                      colorMap[0] = new ColorMap();
                      colorMap[0].OldColor = Color.Fuchsia;
                      colorMap[0].NewColor = Color.FromKnownColor(KnownColor.ButtonFace);
                      ImageAttributes attr = new ImageAttributes();
                      attr.SetRemapTable(colorMap);
                      g.DrawImage(tbBmp_tbTab, new Rectangle(0, 0, 16, 16), 0, 0, 16, 16, GraphicsUnit.Pixel, attr);
                      tbIcon = Icon.FromHandle(newBmp.GetHicon());
                  }
      
                  NppTbData _nppTbData = new NppTbData();
                  _nppTbData.hClient = MpsQcTool.Handle;
                  _nppTbData.pszName = "MPS Qc Tool";
                  _nppTbData.dlgID = idMyDlg;
                  _nppTbData.uMask = NppTbMsg.DWS_DF_CONT_BOTTOM | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR;
                  _nppTbData.hIconTab = (uint)tbIcon.Handle;
                  _nppTbData.pszModuleName = PluginName;
                  IntPtr _ptrNppTbData = Marshal.AllocHGlobal(Marshal.SizeOf(_nppTbData));
                  Marshal.StructureToPtr(_nppTbData, _ptrNppTbData, false);
      
                  Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_DMMREGASDCKDLG, 0, _ptrNppTbData);
              }
              else
              {
                  Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_DMMSHOW, 0, MpsQcTool.Handle);
              }
              get_tree_view();
          }
      
      dailD 1 Reply Last reply Reply Quote 0
      • dailD Offline
        dail @sridhar elangovan
        last edited by

        Have you tried docking it to the left or right?

        Here is how I’ve done it in C++ which has worked fine.

        FYI NppTbMsg.DWS_ICONBAR is not supported at all.

        1 Reply Last reply Reply Quote 0
        • sridhar elangovanS Offline
          sridhar elangovan
          last edited by

          yes dail… i tried everything… but couldnt reset the position . It keep on goes to right side on _nppTbData. It will be so helpfull if you have any solution for this.

          1 Reply Last reply Reply Quote 0
          • dailD Offline
            dail
            last edited by

            Using DWS_DF_CONT_BOTTOM gives the default position but does not force it to go there. Notepad++ remembers the location of the window and will open it back up in the previously known position. I think those settings are stored the config.xml file under <GUIConfig name="DockingManager"

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors