From 9b179090ec937de3c32fb95c99a79053d5be2e00 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 8 Dec 2013 20:39:41 +0000 Subject: correct menu items creation git-svn-id: http://svn.miranda-ng.org/main/trunk@7091 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ProfileManager/src/pmanagerEx.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'plugins/ProfileManager/src') diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 666e74163c..0db2b21155 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -92,22 +92,13 @@ static IconItem iconList[] = { LPGEN("Restart"), SRV_RESTART_ME, IDI_Restart } }; -extern "C" __declspec(dllexport) int Load(void) +static int OnModulesLoaded(WPARAM, LPARAM) { - mir_getLP(&pluginInfo); - - Icon_Register(hInst, LPGEN("Profile manager"), iconList, SIZEOF(iconList)); - - CreateServiceFunction(SRV_LOAD_PM, LoadPM); - CreateServiceFunction(SRV_CHECK_DB, CheckDb); - CreateServiceFunction(SRV_CHANGE_PM, ChangePM); - CreateServiceFunction(SRV_RESTART_ME, RestartMe); - CLISTMENUITEM mi = { sizeof(mi) }; mi.position = -500200000; mi.pszPopupName = LPGEN("Database"); - for (int i=0; i < SIZEOF(iconList); i++) { + for (int i = 0; i < SIZEOF(iconList); i++) { mi.pszName = iconList[i].szDescr; mi.pszService = iconList[i].szName; mi.icolibItem = iconList[i].hIcolib; @@ -120,6 +111,21 @@ extern "C" __declspec(dllexport) int Load(void) return 0; } +extern "C" __declspec(dllexport) int Load(void) +{ + mir_getLP(&pluginInfo); + + Icon_Register(hInst, LPGEN("Profile manager"), iconList, SIZEOF(iconList)); + + CreateServiceFunction(SRV_LOAD_PM, LoadPM); + CreateServiceFunction(SRV_CHECK_DB, CheckDb); + CreateServiceFunction(SRV_CHANGE_PM, ChangePM); + CreateServiceFunction(SRV_RESTART_ME, RestartMe); + + HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + return 0; +} + extern "C" __declspec(dllexport) int Unload(void) { return 0; -- cgit v1.2.3