diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-08 20:39:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-08 20:39:41 +0000 |
commit | 9b179090ec937de3c32fb95c99a79053d5be2e00 (patch) | |
tree | 581f8fab57094b8f3b9d96cd29ff3a90b42a8671 /plugins/ProfileManager | |
parent | 5e56550708e0289713de998724354373ccfddbb7 (diff) |
correct menu items creation
git-svn-id: http://svn.miranda-ng.org/main/trunk@7091 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ProfileManager')
-rw-r--r-- | plugins/ProfileManager/src/pmanagerEx.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
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;
|