Menu

WM_NBOPENFILES returning N+1 files

Franco
2007-05-06
2012-11-14
  • Franco

    Franco - 2007-05-06

    If I issue the command:

    UINT nbFiles = (UINT)SendMessage(nppData._nppHandle, WM_NBOPENFILES, 0, ALL_OPEN_FILES);

    from inside a plugin, I receive back one too many open files.

    I.e. if I have 4 open files, nbFiles=5.

    Is that correct?

    Regards,

     
    • Don HO

      Don HO - 2007-05-06

      It's a correct result.
      You have 4 files opened in main view, and 1 file opened in invisible second view

      UINT nbFiles_1 = (UINT)SendMessage(nppData._nppHandle, NPPM_GETNBOPENFILES, 0, PRIMARY_VIEW);
      UINT nbFiles_2 = (UINT)SendMessage(nppData._nppHandle, NPPM_GETNBOPENFILES, 0, SECOND_VIEW);

      The result of nbFiles_1 and nbFiles_2 is respectively 4 and 1.

      Don

       
MongoDB Logo MongoDB