| 132 | } |
| 133 | |
| 134 | ContextMenuManager::~ContextMenuManager() |
| 135 | { |
| 136 | /* Release the IContextMenu interfaces. */ |
| 137 | for (auto menuHandler : m_MenuHandlers) |
| 138 | { |
| 139 | if (menuHandler.pContextMenuActual != NULL) |
| 140 | { |
| 141 | menuHandler.pContextMenuActual->Release(); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /* ...and free the necessary DLL's. */ |
| 146 | for (auto contextMenuHandler : m_ContextMenuHandlers) |
| 147 | { |
| 148 | contextMenuHandler.pUnknown->Release(); |
| 149 | |
| 150 | if (contextMenuHandler.hDLL != NULL) |
| 151 | { |
| 152 | FreeLibrary(contextMenuHandler.hDLL); |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | bool ContextMenuManager::ShowMenu(HWND hwnd, HMENU hMenu, UINT uIDPrevious, UINT uMinID, |
| 158 | UINT uMaxID, const POINT &pt, StatusBar &statusBar) |