Community
    • Login

    Can't get the current buffer pos now?

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

            @glandon

            Seems to work for me

            pos_by_bufferid.gif

            1 Reply Last reply Reply Quote 2
            • glandonG
              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
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors