Community
    • Login

    Notification for command state changes

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    3 Posts 2 Posters 948 Views 1 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.
    • moon6969M Offline
      moon6969
      last edited by

      My plugin toobar is interested in knowing when an NPP command with a state changes…
      EG:
      View → Word Wrap is turned on or off
      File → Save is enabled or disabled

      Currently I am hooking TB_CHECKBUTTON & TB_ENABLEBUTTON windows messages with SetWindowsHookEx, but hooks make me feel so 90s and a little bit dirty.

      Is there currently a better way to do this?

      If not, would it be best implemented as an NPPN beNotified notification?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE Offline
        Ekopalypse @moon6969
        last edited by

        @moon6969

        there is this messageProc function. Maybe this is providing the info you need!? I’ve never tested it so far.
        The save issue could be solved by subscribing to savepoint-left/reached notifications.

        1 Reply Last reply Reply Quote 2
        • moon6969M Offline
          moon6969
          last edited by

          I had a quick poke through NPP source… the main messageProc call (via _pluginsManager.relayNppMessages) is after the main “process message” Switch in NPPBigSwitch… but only for a few messages with “break”.

          I don’t think the TB_CHECKBUTTON messages make it to the Big Switch though since it has the same 0x402 value as NPPM_INTERNAL_CMDLIST_MODIFIED already present there.

          I’ll dig further if/when I get the chance!

          1 Reply Last reply Reply Quote 3

          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