I've been trying to figure out the best way to handle working with menu item checks. I had thought that NPPM_GETMENUHANDLE and NPPM_SETMENUITEMCHECK would be all that would be needed to let N++ do the heavy lifting. Wrong! Or at least I can't get it to work the way I'd expected.
What I was hoping for was to get the menu handle and send the check message with my modules cmdID.
I've been reading some of the other plugins and haven't found one yet that uses NPPM_GETMENUHANDLE, and that message sure isn't returning what I'd expect using:
Also, if I use the NPPM_SETMENUITEMCHECK then using the module's cmdIDs doesn't work either, unless the module is the only one loaded and the cmdIDs are offset by ID_PLUGINS_CMD.
So what should I be doing here, and what plugin would serve as an example of one that lets N++ do the managment stuff?
almostautomated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been trying to figure out the best way to handle working with menu item checks. I had thought that NPPM_GETMENUHANDLE and NPPM_SETMENUITEMCHECK would be all that would be needed to let N++ do the heavy lifting. Wrong! Or at least I can't get it to work the way I'd expected.
What I was hoping for was to get the menu handle and send the check message with my modules cmdID.
I've been reading some of the other plugins and haven't found one yet that uses NPPM_GETMENUHANDLE, and that message sure isn't returning what I'd expect using:
HMENU hMenu;
::SendMessage(hNpp, NPPM_GETMENUHANDLE, NPPPLUGINMENU, (LRESULT)&hMenu);
So how should I be getting this handle.
Also, if I use the NPPM_SETMENUITEMCHECK then using the module's cmdIDs doesn't work either, unless the module is the only one loaded and the cmdIDs are offset by ID_PLUGINS_CMD.
So what should I be doing here, and what plugin would serve as an example of one that lets N++ do the managment stuff?
almostautomated
LOL,
Told you that was dumb. I was using an enum value of the cmdID instead of the funcItem's cmdID value.
ooops. :P