Skip to content

Instantly share code, notes, and snippets.

@caetanus
Created June 29, 2013 03:47
Show Gist options
  • Select an option

  • Save caetanus/5889636 to your computer and use it in GitHub Desktop.

Select an option

Save caetanus/5889636 to your computer and use it in GitHub Desktop.
template<typename TMenu>
void RegistryMenu::recursiveLoadMenus(TMenu* parent)
{
if (!canLoadMenu)
return;
MU::Menu* menu = NULL;
while (m_reg.getSubKeyCount())
{
auto submenulist = m_reg.getSubKeys();
for(auto iter = submenulist.begin(); iter != submenulist.end(); iter++)
{
menu = new MU::Menu();
m_menus.push_back(menu);
auto curpath = m_reg.getCurrentPath();
m_reg.setKey(curpath + L"\\" + *iter, false);
loadMenu(menu);
recursiveLoadMenus(menu);
*parent << menu;
m_reg.setKey(curpath, false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment