• Login
Community
  • Login

Project plugin functionality

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
22 Posts 5 Posters 1.8k Views
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.
  • G
    General Coder
    last edited by General Coder May 10, 2023, 11:10 AM May 10, 2023, 11:09 AM

    Hi
    I would like to do some function tracking via plugin but I’m unsure where to get started. What I would like to do is use the existing project manager plugin to list the files that I read in my plugin. is this possible?

    thx!

    A 1 Reply Last reply May 10, 2023, 1:55 PM Reply Quote 0
    • A
      Alan Kilborn @General Coder
      last edited by May 10, 2023, 1:55 PM

      @General-Coder

      That’s probably too vague for anyone to effectively comment on it.

      G 1 Reply Last reply May 10, 2023, 2:14 PM Reply Quote 0
      • G
        General Coder @Alan Kilborn
        last edited by May 10, 2023, 2:14 PM

        @Alan-Kilborn

        basically I’m asking if you can use the project manager functionality in your plugin?

        P 1 Reply Last reply May 10, 2023, 2:48 PM Reply Quote 0
        • P
          PeterJones @General Coder
          last edited by PeterJones May 10, 2023, 2:50 PM May 10, 2023, 2:48 PM

          @General-Coder ,

          I’m asking if [I] can use the project manager functionality in [my] plugin?

          If the “project manager” is really a plugin, and assuming you have the skills to do so, there are two ways that I know of:

          1. Assuming this “project manager” plugin is open source, you could include the source code for that plugin as part of the source code for your plugin. It is up to you to make sure that licenses are compatible and all legal requirements are fulfilled.
          2. The NPPM_MSGTOPLUGIN message in Plugin Communication is meant so that plugin A can communicate with plugin B. So, if the “project manager plugin” accepts messages, your plugin could use NPPM_MSGTOPLUGIN to send messages to the “project manager plugin”.

          But I have never heard of plugin called “project manager”. (That, and your terse phrasing, are probably what caused Alan’s confusion as well.)

          If you are really referring to Notepad++'s built-in Project panels – as far as I can tell, none of Notepad++ messages for the Plugin Communication interface give access to the Project Panels.

          However, someone with a lot of experience with the win32 API, or good internet-search-skills, could probably figure out the handles to the Project Panel GUI elements, and can probably figure out how to manually trigger the various clicks and actions necessary to remote-control that interface => but that’s a generic Win32 programming problem and you would probably find more answers at a site for Win32-programming in specific or at a stack overflowing with programming questions; some possible internet search terms might include “win32 searching for child windows”, “win32 get control IDs for child controls of a window”, “win32 trigger a button from another window”.

          1 Reply Last reply Reply Quote 3
          • G
            General Coder
            last edited by PeterJones May 10, 2023, 4:07 PM May 10, 2023, 3:43 PM

            Thx for the reply.

            I was probably wrong that project manager is a plugin. But this is what I mean anyway:

            —
            edit: moderator changed from link-to-image to shown image

            P 1 Reply Last reply May 10, 2023, 4:09 PM Reply Quote 0
            • P
              PeterJones @General Coder
              last edited by May 10, 2023, 4:09 PM

              @General-Coder said in Project plugin functionality:

              But this is what I mean

              Ah, okay, any of my comments about the built-in “Project Panels” also apply to “Folder as Workspace”, which is a similar feature, documented in the same section of the User Manual.

              So no, there are no NPPM_ messages for talking to either Project Panels or Folder as Workspace. But if you dig into win32-api programming, you should be able to interact with those elements

              G 1 Reply Last reply May 10, 2023, 4:15 PM Reply Quote 1
              • G
                General Coder @PeterJones
                last edited by May 10, 2023, 4:15 PM

                @PeterJones said in Project plugin functionality:

                So no, there are no NPPM_ messages for talking to either Project Panels or Folder as Workspace. But if you dig into win32-api programming, you should be able to interact with those elements

                sorry I don’t understand. You mean interact with the win32 GUI? or the data…

                E 1 Reply Last reply May 10, 2023, 5:21 PM Reply Quote 0
                • E
                  Ekopalypse @General Coder
                  last edited by May 10, 2023, 5:21 PM

                  @General-Coder

                  yes, you need to use Win32 api calls to interact with the FAW.
                  Something like what I am doing here .

                  1 Reply Last reply Reply Quote 1
                  • G
                    General Coder
                    last edited by General Coder May 10, 2023, 6:15 PM May 10, 2023, 6:15 PM

                    thx for the reply

                    my win32 skills are very rusty so if someone could show me an example of how to receive the file list from the workspace or something simpler I would appreciated it

                    I’m coding with C#

                    thx!

                    P 1 Reply Last reply May 10, 2023, 6:51 PM Reply Quote 0
                    • P
                      PeterJones @General Coder
                      last edited by May 10, 2023, 6:51 PM

                      @General-Coder said in Project plugin functionality:

                      my win32 skills are very rusty so if someone could show me

                      As I said earlier,

                      … but that’s a generic Win32 programming problem and you would probably find more answers at a site for Win32-programming in specific or at a stack overflowing with programming questions;

                      Given your recent comments that you want to grab the list of files out of the treeview, I might recommend searching the internet for c# csharp win32-api grab values from treeview control along with the other searches I recommended above. Or use Eko’s example – it might be in a different programming language, but it gives the same basic idea, and one benefit of the “win32 API” being an “API” is that the function names are the same across languages (or mostly so). But, in general, this Community focuses on Notepad++, and this Plugin Development category is focused on the Notepad+±specific aspects of plugin programming; a plugin programmer is expected to understand how to do the generic win32 API framework around their Notepad+±specific calls. And extracting the list out of a treeview control is not specific to Notepad++.

                      1 Reply Last reply Reply Quote 3
                      • G
                        General Coder
                        last edited by General Coder May 11, 2023, 1:03 PM May 11, 2023, 1:02 PM

                        Well I’ve learned reading the treeview is not an easy task especially if you are using C#.
                        So I would like to forget it. But what about the functions list in notepad++, can you somehow use that? And can you allow jump to function definition via context menu. I should probably make a new thread about this…

                        P 1 Reply Last reply May 11, 2023, 2:29 PM Reply Quote 0
                        • P
                          PeterJones @General Coder
                          last edited by May 11, 2023, 2:29 PM

                          @General-Coder said in Project plugin functionality:

                          I should probably make a new thread about this…

                          Don’t bother.

                          what about the functions list in notepad++, can you somehow use that?

                          Nope. The Function List panel also does not have any messages for a plugin to call, so once again, you would be using the generic Win32 API calls – and IIRC, it’s a TreeView as well, so there’s no benefit of trying to access that over trying the Project or FolderAsWorkspace.

                          1 Reply Last reply Reply Quote 1
                          • G
                            General Coder
                            last edited by May 11, 2023, 2:40 PM

                            What about my own context menu entry (that calls my C# function) or custom hovering tooltip type display, are those possible?

                            P E 2 Replies Last reply May 11, 2023, 3:12 PM Reply Quote 0
                            • P
                              PeterJones @General Coder
                              last edited by May 11, 2023, 3:12 PM

                              @General-Coder ,

                              What about my own context menu entry (that calls my C# function) or custom hovering tooltip type display, are those possible?

                              I am sure such are possible. I think they are probably done with standard Win32 API calls, but I don’t know for sure. I know that some of the other regulars here have done their own popups and such, so hopefully someone else will be able to give you pointers as where to go next.

                              1 Reply Last reply Reply Quote 2
                              • E
                                Ekopalypse @General Coder
                                last edited by May 12, 2023, 6:56 AM

                                @General-Coder

                                If it is the context menu that opens in the Scintilla area, then it is editable via Settings->Edit Popup ContextMenu. See here . But if you’re thinking of having it in other dialogs like FAW, Project Panel, or third-party plugins like NppExec, then you’ll need to subclass the appropriate window message queue and catch the messages you’re interested in, do your own thing, and let the main message handler know that this was done to prevent the main action from being executed.

                                1 Reply Last reply Reply Quote 3
                                • G
                                  General Coder
                                  last edited by May 12, 2023, 8:59 AM

                                  I have put my own entry to the context menu via xml but now would like to do that via C# plugin. Is this possible?
                                  The link you gave me brings up security warning (which is why I haven’t been reading those docs)

                                  I’m also wondering if it’s possible to use windows form under notepad++ process or do I have to use np++ own window creation commands?

                                  I was able to create the form but it’s in independent process.

                                  M E 2 Replies Last reply May 12, 2023, 3:00 PM Reply Quote 0
                                  • M
                                    mkupper @General Coder
                                    last edited by May 12, 2023, 3:00 PM

                                    @General-Coder said in Project plugin functionality:

                                    The link you gave me brings up security warning (which is why I haven’t been reading those docs)

                                    This has been fixed and so https://npp-user-manual.org/docs/config-files/#the-context-menu-contextmenu-xml should now be viewable.

                                    1 Reply Last reply Reply Quote 2
                                    • E
                                      Ekopalypse @General Coder
                                      last edited by May 13, 2023, 6:13 AM

                                      @General-Coder said in Project plugin functionality:

                                      … now would like to do that via C# plugin. Is this possible?

                                      Yes, you need to subclass the wndproc …

                                      … possible to use windows form under notepad++

                                      Even though I’m not a C# developer, I can say that yes, you can.
                                      The .Net framework is basically a wrapper around the Win32 API.
                                      You just need to make sure that you pass the expected values to Npp.

                                      1 Reply Last reply Reply Quote 3
                                      • G
                                        General Coder
                                        last edited by May 17, 2023, 3:10 PM

                                        couple questions

                                        how do you center the view on line? I used SciMsg.SCI_GOTOLINE to go to the line but it doesn’t center the view

                                        also is it possible to get the text under the cursor? i can get selection but this one I havent figured out yet

                                        thx

                                        A 1 Reply Last reply May 17, 2023, 5:04 PM Reply Quote 0
                                        • A
                                          Alan Kilborn @General Coder
                                          last edited by May 17, 2023, 5:04 PM

                                          @General-Coder said in Project plugin functionality:

                                          couple questions

                                          What you are asking about are some Scintilla functions.
                                          The Scintilla docs are HERE .

                                          1 Reply Last reply Reply Quote 1
                                          9 out of 22
                                          • First post
                                            9/22
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors