The question in comments copied below:
In case of sub-menu, how/why (_posBase+j) results in insertion at position after the 2 items: "empty recent files list" and bar, instead of at the top, because (_posBase) is position at the top of the sub-menu ?
Before this for-loop, if _size>0 ( and unless _pAccelerator->updateFullMenu(); does some tricks), in sub-menu have already next 4 items at top: (below I use abbreviations of the menu items; 1st is Restore Recent Closed File)
https://github.com/victorel-petrovich/notepad-plus-plus_lastRecentFileList.cpp/blob/26f402a71ec6ab86a07396a6249fadb5ee210dac/PowerEditor/src/lastRecentFileList.cpp#L390
The question in comments copied below: In case of sub-menu, how/why (_posBase+j) results in insertion at position after the 2 items: "empty recent files list" and bar, instead of at the top, because (_posBase) is position at the top of the sub-menu ?
Before this for-loop, if _size>0 ( and unless _pAccelerator->updateFullMenu(); does some tricks), in sub-menu have already next 4 items at top: (below I use abbreviations of the menu items; 1st is Restore Recent Closed File)
If it was intended to placce after the last 2 items, then must have use (posBase+4+j), I think ?