Is there a standard way of adding a menu to the already existing NotePad++ menu bar? Is it possible to add this extra menu item dynamically?
If so, where is this written down?
Best rgds,
--Geert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suppose thqt Chris Severance (severach at users.sourceforge.net) can explain it very well as he uses that capacity of NPP for the TextFx PlugIn. you can see his code (http://textfx.no-ip.com/textfx/NPPTextFX23-v0.23ReleaseSource.zip) ... Enjoye, and see you tomorrow.
Nico
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yep, I did contact Chris and verified his code, but what harrybharry said in his reply was in fact the clue key: Just use GetMenu(), so you get the pointer to the NPP menu and then you can traverse the menu (had a look to the code of Chris for that) until you find the menu item after which you want to add your menu item.
Works fine, but I still have to figure out how to remove the name of my plugin from the Plugins menu section.
What I did was returning NULL for the GetName() function, but then I get a kind of separator in the Plugins menu.
So, now I have my "own" menu in the menu bar, but next to this I have the separator in the Plugins menu, which I want to get rid of.
Maybe someone does know how to avoid to add my plug-in to the list of plug-ins in the Plugins menu? Don Ho maybe?
Best rgds,
--Geert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only way (for me) to do what you want is (even though it's not recommanded) :
1. Keep using the plugin interface normally (don't return NULL for GetName() function.)
2. Use GetMenu() to have menu handle .
3. Add your new menu entry and remove the old menu entry by using the menu handle you've got.
Don
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Is there a standard way of adding a menu to the already existing NotePad++ menu bar? Is it possible to add this extra menu item dynamically?
If so, where is this written down?
Best rgds,
--Geert
coucou Geert,
I suppose thqt Chris Severance (severach at users.sourceforge.net) can explain it very well as he uses that capacity of NPP for the TextFx PlugIn. you can see his code (http://textfx.no-ip.com/textfx/NPPTextFX23-v0.23ReleaseSource.zip) ... Enjoye, and see you tomorrow.
Nico
Bonjour, monsieur Salocin treize...
Yep, I did contact Chris and verified his code, but what harrybharry said in his reply was in fact the clue key: Just use GetMenu(), so you get the pointer to the NPP menu and then you can traverse the menu (had a look to the code of Chris for that) until you find the menu item after which you want to add your menu item.
Works fine, but I still have to figure out how to remove the name of my plugin from the Plugins menu section.
What I did was returning NULL for the GetName() function, but then I get a kind of separator in the Plugins menu.
So, now I have my "own" menu in the menu bar, but next to this I have the separator in the Plugins menu, which I want to get rid of.
Maybe someone does know how to avoid to add my plug-in to the list of plug-ins in the Plugins menu? Don Ho maybe?
Best rgds,
--Geert
The only way (for me) to do what you want is (even though it's not recommanded) :
1. Keep using the plugin interface normally (don't return NULL for GetName() function.)
2. Use GetMenu() to have menu handle .
3. Add your new menu entry and remove the old menu entry by using the menu handle you've got.
Don
Ok, will try this.
Question: why do you say it's not recommended? Any particular reason?
Best rgds,
--Geert
I think you can use HMENU GetMenu(HWND nppData._nppHandle) to retrieve the menu, then change it to your likings