summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/ProfileManager/src/pmanagerEx.cpp28
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;