MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / get_this_plugin_menu

Function get_this_plugin_menu

src/plugin/Plugin.cpp:353–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351static HMENU dspellcheck_menu_cached = nullptr;
352
353HMENU get_this_plugin_menu() {
354 if (dspellcheck_menu_cached)
355 return dspellcheck_menu_cached;
356 HMENU plugins_menu = npp->get_menu_handle(NPPPLUGINMENU);
357 HMENU dspellcheck_menu = nullptr;
358 int count = GetMenuItemCount(plugins_menu);
359 for (int i = 0; i < count; i++) {
360 auto str = get_menu_item_text(plugins_menu, i);
361 if (str == getName()) {
362 MENUITEMINFO mif;
363 mif.fMask = MIIM_SUBMENU;
364 mif.cbSize = sizeof(MENUITEMINFO);
365 bool res = GetMenuItemInfo(plugins_menu, i, TRUE, &mif) != FALSE;
366
367 if (res)
368 dspellcheck_menu = mif.hSubMenu;
369 break;
370 }
371 }
372 return dspellcheck_menu_cached = dspellcheck_menu;
373}
374
375HMENU get_submenu(int item_id) {
376 auto dspellcheck_menu = get_this_plugin_menu();

Callers 3

get_submenuFunction · 0.85
rearrange_menuFunction · 0.85

Calls 3

get_menu_item_textFunction · 0.85
getNameFunction · 0.85
get_menu_handleMethod · 0.80

Tested by

no test coverage detected