bool NotepadPlusWrapper::runPluginCommand(boost::python::str pluginName, boost::python::str menuOption, bool refreshCache) { bool retVal = false; MenuManager *menuManager = MenuManager::getInstance(); if (!pluginName.is_none() && !menuOption.is_none()) { std::shared_ptr<TCHAR> tpluginName = WcharMbcsConverter::char2tchar(boost::python::extract<const char *>(pluginName)); std::shared_ptr<TCHAR> tmenuOption = WcharMbcsConverter::char2tchar(boost::python::extract<const char *>(menuOption)); GILRelease release; idx_t commandID = menuManager->findPluginCommand(tpluginName.get(), tmenuOption.get(), refreshCache); if (commandID) { ::SendMessage(m_nppHandle, WM_COMMAND, commandID, 0); retVal = true; } } return retVal; }