Community
    • Login

    Can't get the current buffer pos now?

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    5 Posts 3 Posters 1.1k 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.
    • glandonG Offline
      glandon
      last edited by

      Abut 5 years ago, my code worked well, but now as the snapshot below, it’s a bug?

      Not used the mask with wparam, but check equal directly!

      截屏2024-05-02 12.55.14.png

      glandonG 1 Reply Last reply Reply Quote 0
      • glandonG Offline
        glandon @glandon
        last edited by

        int bufID = ::SendMessage(g_nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);
        int which = ::SendMessage(g_nppData._nppHandle, NPPM_GETPOSFROMBUFFERID, bufID, 0);
        

        Always return -1

        CoisesC EkopalypseE glandonG 3 Replies Last reply Reply Quote 0
        • CoisesC Offline
          Coises @glandon
          last edited by

          @glandon

          Just looking quickly at what you have, the id in your screenshot is 64 bits. When compiling for 64-bit windows, int is 32 bits but LPARAM is 64 bits.

          1 Reply Last reply Reply Quote 3
          • EkopalypseE Offline
            Ekopalypse @glandon
            last edited by

            @glandon

            Seems to work for me

            pos_by_bufferid.gif

            1 Reply Last reply Reply Quote 2
            • glandonG Offline
              glandon @glandon
              last edited by

              @glandon OK, please forgive my ignorance

              LRESULT bufID = ::SendMessage(g_nppData._nppHandle, NPPM_GETCURRENTBUFFERID, 0, 0);
              
              1 Reply Last reply Reply Quote 1

              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