Community
    • Login

    Plugin Source

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    14 Posts 6 Posters 2.7k 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.
    • PeterJonesP
      PeterJones
      last edited by

      There is no requirement for a plugin to publish its source code. Even when available, the source code usually won’t come bundled if you download it through the Plugins Admin. You can check the plugin’s individual website to see if it’s available.

      1 Reply Last reply Reply Quote 2
      • andrecool-68A
        andrecool-68
        last edited by andrecool-68

        Something strange …plugins which I use you can freely download the source code

        And the authors of these plugins helped me with advice on how to compile these projects! For which they thank you!

        Meta ChuhM 1 Reply Last reply Reply Quote 1
        • Meta ChuhM
          Meta Chuh moderator @andrecool-68
          last edited by

          @andrecool-68

          yes, and most of the plugins are open source.

          but there are many developers that published source code, and had a very bad experience, as some rogue entities took profit on selling it, and worst case, trying or accomplishing to patent, what they have taken from another person’s open source project.

          so i can fully understand why some developers, especially the ones with a lot of bad experiences, choose to omit to publish any further source codes.

          andrecool-68A 1 Reply Last reply Reply Quote 1
          • andrecool-68A
            andrecool-68 @Meta Chuh
            last edited by andrecool-68

            @Meta-Chuh
            Me a thief and a bad seller turns out)))
            Parents are not taught to steal)))

            Meta ChuhM 1 Reply Last reply Reply Quote 1
            • Meta ChuhM
              Meta Chuh moderator @andrecool-68
              last edited by

              @andrecool-68

              of course i did not mean you, but big, big enterprises.
              i hope this was a joke from you, because otherwise maybe you need a better translator after all 😉

              andrecool-68A 1 Reply Last reply Reply Quote 2
              • andrecool-68A
                andrecool-68 @Meta Chuh
                last edited by

                @Meta-Chuh
                A translator is a robot, not a living person. You want to say one thing, but it turns out quite another.

                1 Reply Last reply Reply Quote 1
                • Tod MarT
                  Tod Mar
                  last edited by

                  Super I’m glad I started the conversation but my 2nd question was where to find any doc. about adding icons to the toolbar and getting their events. I can search and find it but if anyone can point me anywhere. Also…the code here is classic Windows code without even MFC or ATL/WTL I assume?

                  Alan KilbornA 1 Reply Last reply Reply Quote 1
                  • Alan KilbornA
                    Alan Kilborn @Tod Mar
                    last edited by

                    @Tod-Mar said:

                    the code here is classic Windows code without even MFC or ATL/WTL I assume?

                    Yes…double-edged sword I guess. Personally, I’m glad it is not MFC-based. I always found MFC to be a joke.

                    1 Reply Last reply Reply Quote 0
                    • Tod MarT
                      Tod Mar
                      last edited by

                      Yet some plugins are C#. I thought C# was only a .Net platform, but they could be compiled with .NET Native…

                      Alan KilbornA 1 Reply Last reply Reply Quote 0
                      • Alan KilbornA
                        Alan Kilborn @Tod Mar
                        last edited by Alan Kilborn

                        @Tod-Mar

                        You can write plugins in a lot of languages. Notepad++ itself is as you said, “classic Windows code”, C++ and straight Windows API function calls, so maybe the natural choice for a plugin is to stick with same.

                        1 Reply Last reply Reply Quote 0
                        • Tod MarT
                          Tod Mar
                          last edited by

                          So you do everything using window handles and messages? how about icons/images? (looking at the toolbar…)

                          1 Reply Last reply Reply Quote 0
                          • dinkumoilD
                            dinkumoil
                            last edited by dinkumoil

                            @Tod-Mar

                            When I started to develop plugins for Notepad++ the following links have been helpful:

                            How to develop a plugin or a lexer
                            Messages and notifications
                            Sources of plugin interface
                            Scintilla documentation

                            Regarding toolbar buttons

                            The handling of toolbar buttons is totally transparent to a plugin developer because they work like a menu entry.

                            A plugin developer has to fill an array at plugin’s startup that contains structs of type FuncItem. Every array element describes a menu entry of the plugin (text, click handler function, menu command id, Checked state, and keyboard shortcut).

                            Notepad++ queries a pointer to this array at a certain time in the startup process. It generates the menu entry of the plugin in the Plugins menu, adds for every array element a submenu entry and fills the menu command id member of the array elements. So you know the menu command ids of your menu entries.

                            If you want to have a toolbar button you have to hook the NPPN_TB_MODIFICATION event sent by Notepad++ to your plugin. In the handler of this event you have to fill a struct of type toolbarIcons (please note: you have to fill only one of its two members, either hToolbarBmp or hToolbarIcon but it seems only the first one works). The bitmap whose handle you provide has to be in a 8 bits-per-pixel palletized format (max. 256 colors) and its size has to be 16x16 pixels. Then you can send a NPPM_ADDTOOLBARICON event to Notepad++ where you provide the menu command id of the menu entry which you want to connect with your toolbar button and a pointer to the toolbarIcons struct you filled before.

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