Ejemplo n.º 1
0
void InitCustomMenus()
{
	CreateServiceFunction( "CloseAction", CloseAction );
}
Ejemplo n.º 2
0
static void TSAPI InitAPI()
{
	CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
	CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand_W);
	CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI);
	CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass);
	CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData);
	CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);

	CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);
	CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand);
	CreateServiceFunction(MS_TABMSG_SETUSERPREFS, SetUserPrefs);
	CreateServiceFunction(MS_TABMSG_TRAYSUPPORT, Service_OpenTrayMenu);
	CreateServiceFunction(MS_TABMSG_SLQMGR, CSendLater::svcQMgr);

	CreateServiceFunction(MS_MSG_MOD_GETWINDOWFLAGS, GetMessageWindowFlags);
	CreateServiceFunction(MS_MSG_MOD_MESSAGEDIALOGOPENED, MessageWindowOpened);

	SI_InitStatusIcons();
	CB_InitCustomButtons();

	// the event API
	PluginConfig.m_event_MsgWin = CreateHookableEvent(ME_MSG_WINDOWEVENT);
	PluginConfig.m_event_MsgPopup = CreateHookableEvent(ME_MSG_WINDOWPOPUP);
	PluginConfig.m_event_WriteEvent = CreateHookableEvent(ME_MSG_PRECREATEEVENT);
}
Ejemplo n.º 3
0
int LoadChatModule(void)
{
	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
	HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);

	CreateServiceFunction(MS_GC_REGISTER, Service_Register);
	CreateServiceFunction(MS_GC_NEWSESSION, Service_NewChat);
	CreateServiceFunction(MS_GC_EVENT, Service_AddEvent);
	CreateServiceFunction(MS_GC_GETEVENTPTR, Service_GetAddEventPtr);
	CreateServiceFunction(MS_GC_GETINFO, Service_GetInfo);
	CreateServiceFunction(MS_GC_GETSESSIONCOUNT, Service_GetCount);

	CreateServiceFunction("GChat/DblClickEvent", EventDoubleclicked);
	CreateServiceFunction("GChat/PrebuildMenuEvent", PrebuildContactMenuSvc);
	CreateServiceFunction("GChat/JoinChat", JoinChat);
	CreateServiceFunction("GChat/LeaveChat", LeaveChat);
	CreateServiceFunction("GChat/GetInterface", SvcGetChatManager);

	ci.hSendEvent = CreateHookableEvent(ME_GC_EVENT);
	ci.hBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
	hHookEvent = CreateHookableEvent(ME_GC_HOOK_EVENT);

	HookEvent(ME_FONT_RELOAD, FontsChanged);
	HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);

	bInited = true;
	return 0;
}
Ejemplo n.º 4
0
int InitEvents(void)
{
	CreateServiceFunction(MS_DB_EVENT_GETCOUNT,GetEventCount);
	CreateServiceFunction(MS_DB_EVENT_ADD,AddEvent);
	CreateServiceFunction(MS_DB_EVENT_DELETE,DeleteEvent);
	CreateServiceFunction(MS_DB_EVENT_GETBLOBSIZE,GetBlobSize);
	CreateServiceFunction(MS_DB_EVENT_GET,GetEvent);
	CreateServiceFunction(MS_DB_EVENT_MARKREAD,MarkEventRead);
	CreateServiceFunction(MS_DB_EVENT_GETCONTACT,GetEventContact);
	CreateServiceFunction(MS_DB_EVENT_FINDFIRST,FindFirstEvent);
	CreateServiceFunction(MS_DB_EVENT_FINDFIRSTUNREAD,FindFirstUnreadEvent);
	CreateServiceFunction(MS_DB_EVENT_FINDLAST,FindLastEvent);
	CreateServiceFunction(MS_DB_EVENT_FINDNEXT,FindNextEvent);
	CreateServiceFunction(MS_DB_EVENT_FINDPREV,FindPrevEvent);
	hEventDeletedEvent=CreateHookableEvent(ME_DB_EVENT_DELETED);
	hEventAddedEvent=CreateHookableEvent(ME_DB_EVENT_ADDED);
	hEventFilterAddedEvent=CreateHookableEvent(ME_DB_EVENT_FILTER_ADD);
	return 0;
}
Ejemplo n.º 5
0
void InitGroupMenus(void)
{
	HICON hicon = LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,0);
	NewGroupIconidx = ImageList_AddIcon(hCListImages,hicon );

	CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
	CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
	CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService",GroupMenuonAddService);
	CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper",HideGroupsHelper);
	CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper",UseGroupsHelper);
	CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);

	CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
	CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
	CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
	hPreBuildGroupMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
	HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);

	InitSubGroupMenus();

	// Group menu
	hGroupMenuObject = MO_CreateMenuObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
	MO_SetMenuObjectParam(hGroupMenuObject, OPT_USERDEFINEDITEMS, TRUE);
	MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
	MO_SetMenuObjectParam(hGroupMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuonAddService");
	{
		//add  exit command to menu
		GroupMenuParam gmp;

		CLISTMENUITEM mi = { sizeof(mi) };
		mi.position = 1900000;
		mi.pszService = "CloseAction";
		mi.pszName = LPGEN("E&xit");
		AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 500;
		mi.pszService = MS_CLIST_SHOWHIDE;
		mi.pszName = LPGEN("&Hide/Show");
		hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 200000;
		mi.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_FINDUSER));
		mi.pszService = "FindAdd/FindAddCommand";
		mi.pszName = LPGEN("&Find/Add Contacts...");
		AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 300000;
		mi.pszService = "";
		mi.pszName = LPGEN("&Main menu");
		hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 300100;
		mi.pszService = "";
		mi.pszName = LPGEN("&Status");
		hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 400000;
		mi.hIcon = LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_OPTIONS));
		mi.pszService = "Options/OptionsCommand";
		mi.pszName = LPGEN("&Options...");

		AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 500000;
		mi.hIcon = LoadIcon(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
		mi.pszService = "Help/AboutCommand";
		mi.pszName = LPGEN("&About");

		//AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 100000;
		mi.hIcon = ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
		mi.pszService = MS_CLIST_GROUPCREATE;
		mi.pszName = LPGEN("&New Group");
		hNewGroupMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 100001;
		mi.hIcon = NULL;
		mi.pszService = MS_CLIST_SETHIDEOFFLINE;
		mi.pszName = LPGEN("&Hide Offline Users");
		gmp.lParam = 0;gmp.wParam = -1;
		hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 100002;
		mi.hIcon = NULL;
		mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
		mi.pszName = LPGEN("Hide &Offline Users out here");
		hHideOfflineUsersOutHereMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 100003;
		mi.hIcon = NULL;
		mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
		mi.pszName = LPGEN("Hide &Empty Groups");
		hHideEmptyGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);

		memset(&mi,0,sizeof(mi));
		mi.cbSize = sizeof(mi);
		mi.position = 100004;
		mi.hIcon = NULL;
		mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
		mi.pszName = LPGEN("Disable &Groups");
		hDisableGroupsMenuItem = (HGENMENU)AddGroupMenuItem(0,(LPARAM)&mi);

		HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
	}
}
Ejemplo n.º 6
0
extern "C" __declspec(dllexport) int Load()
{
	mir_getLP(&pluginInfo);
	mir_getCLI();

	hHttpAcceptConnectionsService = CreateServiceFunction(MS_HTTP_ACCEPT_CONNECTIONS, nToggelAcceptConnections);
	if (!hHttpAcceptConnectionsService) {
		MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_ACCEPT_CONNECTIONS"), MSG_BOX_TITEL, MB_OK);
		return 1;
	}

	hHttpAddChangeRemoveService = CreateServiceFunction(MS_HTTP_ADD_CHANGE_REMOVE, nAddChangeRemoveShare);
	if (!hHttpAddChangeRemoveService) {
		MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_ADD_CHANGE_REMOVE"), MSG_BOX_TITEL, MB_OK);
		return 1;
	}

	hHttpGetShareService = CreateServiceFunction(MS_HTTP_GET_SHARE, nGetShare);
	if (!hHttpGetShareService) {
		MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_GET_SHARE"), MSG_BOX_TITEL, MB_OK);
		return 1;
	}

	hHttpGetAllShares = CreateServiceFunction(MS_HTTP_GET_ALL_SHARES, nHttpGetAllShares);
	if (!hHttpGetAllShares) {
		MessageBox(NULL, _T("Failed to CreateServiceFunction MS_HTTP_GET_ALL_SHARES"), MSG_BOX_TITEL, MB_OK);
		return 1;
	}


	hEventSystemInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit);
	if (!hEventSystemInit) {
		MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_MODULESLOADED"), MSG_BOX_TITEL, MB_OK);
		return 1;
	}

	hPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
	if (!hPreShutdown) {
		MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_PRESHUTDOWN"), MSG_BOX_TITEL, MB_OK);
		return 1;
	}

	if (CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szPluginPath)) {
		MessageBox(NULL, _T("Failed to retrieve plugin path."), MSG_BOX_TITEL, MB_OK);
		return 1;
	}
	mir_tstrncat(szPluginPath, _T("\\HTTPServer\\"), _countof(szPluginPath) - mir_tstrlen(szPluginPath));
	int err = CreateDirectoryTree(szPluginPath);
	if ((err != 0) && (err != ERROR_ALREADY_EXISTS)) {
		MessageBox(NULL, _T("Failed to create HTTPServer directory."), MSG_BOX_TITEL, MB_OK);
		return 1;
	}

	nPluginPathLen = (int)mir_strlen(szPluginPath);

	sLogFilePath = szPluginPath;
	sLogFilePath += "HTTPServer.log";

	if (!bInitMimeHandling())
		MessageBox(NULL, "Failed to read configuration file : " szMimeTypeConfigFile, MSG_BOX_TITEL, MB_OK);

	nMaxUploadSpeed = db_get_dw(NULL, MODULE, "MaxUploadSpeed", nMaxUploadSpeed);
	nMaxConnectionsTotal = db_get_dw(NULL, MODULE, "MaxConnectionsTotal", nMaxConnectionsTotal);
	nMaxConnectionsPerUser = db_get_dw(NULL, MODULE, "MaxConnectionsPerUser", nMaxConnectionsPerUser);
	bLimitOnlyWhenOnline = db_get_b(NULL, MODULE, "LimitOnlyWhenOnline", bLimitOnlyWhenOnline) != 0;
	indexCreationMode = (eIndexCreationMode)db_get_b(NULL, MODULE, "IndexCreationMode", 2);

	if (db_get_b(NULL, MODULE, "AddAcceptConMenuItem", 1)) {
		CMenuItem mi;
		SET_UID(mi, 0xf0a68784, 0xc30e, 0x4245, 0xb6, 0x2b, 0xb8, 0x71, 0x7e, 0xe6, 0xe1, 0x73);
		mi.flags = CMIF_TCHAR;
		mi.hIcolibItem = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
		mi.position = 1000085000;
		mi.name.a = LPGENT("Enable HTTP server");
		mi.pszService = MS_HTTP_ACCEPT_CONNECTIONS;
		hAcceptConnectionsMenuItem = Menu_AddMainMenuItem(&mi);
	}

	if (indexCreationMode == INDEX_CREATION_HTML || indexCreationMode == INDEX_CREATION_DETECT)
		if (!LoadIndexHTMLTemplate()) {
			indexCreationMode = INDEX_CREATION_DISABLE;
			db_set_b(NULL, MODULE, "IndexCreationMode", (BYTE)indexCreationMode);
		}

	hEventProtoAck = HookEvent(ME_PROTO_ACK, nProtoAck);
	return 0;
}
Ejemplo n.º 7
0
int LoadContactListModule()
{
	CreateServiceFunction(MS_CLIST_RETRIEVE_INTERFACE, srvRetrieveInterface);
	return 0;
}
Ejemplo n.º 8
0
int CLUIServices_LoadModule(void)
{
	CreateServiceFunction(MS_CLUI_METASUPPORT,MetaSupportCheck);
	CreateServiceFunction(MS_CLIST_GETSTATUSMODE,CListTray_GetGlobalStatus);
	return 0;
}
Ejemplo n.º 9
0
int InitTime(void)
{
	CreateServiceFunction(MS_DB_TIME_TIMESTAMPTOLOCAL,TimestampToLocal);
	CreateServiceFunction(MS_DB_TIME_TIMESTAMPTOSTRING,TimestampToString);
	return 0;
}
Ejemplo n.º 10
0
int LoadContactListModule2(void)
{
	HookEvent(ME_SYSTEM_MODULESLOADED, ContactListModulesLoaded);
	HookEvent(ME_PROTO_ACCLISTCHANGED, ContactListAccountsChanged);
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
	HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
	HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
	HookEvent(ME_PROTO_ACK, ProtocolAck);

	hContactDoubleClicked = CreateHookableEvent(ME_CLIST_DOUBLECLICKED);
	hContactIconChangedEvent = CreateHookableEvent(ME_CLIST_CONTACTICONCHANGED);

	LoadCluiServices();

	CreateServiceFunction(MS_CLIST_CONTACTDOUBLECLICKED, ContactDoubleClicked);
	CreateServiceFunction(MS_CLIST_CONTACTFILESDROPPED, ContactFilesDropped);
	CreateServiceFunction(MS_CLIST_INVALIDATEDISPLAYNAME, InvalidateDisplayName);
	CreateServiceFunction(MS_CLIST_CONTACTSCOMPARE, CompareContacts);
	CreateServiceFunction(MS_CLIST_CONTACTCHANGEGROUP, ContactChangeGroup);
	CreateServiceFunction(MS_CLIST_SHOWHIDE, ShowHideStub);
	CreateServiceFunction(MS_CLIST_SETHIDEOFFLINE, SetHideOfflineStub);
	CreateServiceFunction(MS_CLIST_DOCKINGPROCESSMESSAGE, Docking_ProcessWindowMessageStub);
	CreateServiceFunction(MS_CLIST_DOCKINGISDOCKED, Docking_IsDocked);
	CreateServiceFunction(MS_CLIST_HOTKEYSPROCESSMESSAGE, HotkeysProcessMessageStub);
	CreateServiceFunction(MS_CLIST_GETCONTACTICON, GetContactIcon);

	InitCListEvents();
	InitGroupServices();
	cli.pfnInitTray();

	hCListImages = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 13, 0);
	HookEvent(ME_SKIN_ICONSCHANGED, CListIconsChanged);
	CreateServiceFunction(MS_CLIST_GETICONSIMAGELIST, GetIconsImageList);

	ImageList_AddIcon_NotShared(hCListImages, MAKEINTRESOURCE(IDI_BLANK));

	// now all core skin icons are loaded via icon lib. so lets release them
	for (int i = 0; i < _countof(statusModeList); i++)
		ImageList_AddIcon_IconLibLoaded(hCListImages, skinIconStatusList[i]);

	// see IMAGE_GROUP... in clist.h if you add more images above here
	ImageList_AddIcon_IconLibLoaded(hCListImages, SKINICON_OTHER_GROUPOPEN);
	ImageList_AddIcon_IconLibLoaded(hCListImages, SKINICON_OTHER_GROUPSHUT);
	return 0;
}
Ejemplo n.º 11
0
void InitGroupMenus(void)
{
	GroupMenuParam gmp = {};

	// Group menu
	CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
	CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);

	hEventPreBuildGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
	HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);

	hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService");
	Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
	Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
	Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuOnAddService");
	{
		CMenuItem mi;
		mi.position = 100000;
		mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUPADD);
		mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
		mi.name.a = LPGEN("&New group");
		Menu_AddGroupMenuItem(&mi);
		CreateServiceFunction(mi.pszService, CreateGroupHelper);

		mi.position = 500001;
		mi.hIcolibItem = NULL;
		mi.pszService = MS_CLIST_SETHIDEOFFLINE;
		mi.name.a = LPGEN("&Hide offline users");
		gmp.wParam = -1;
		hHideOfflineUsersMenuItem = Menu_AddGroupMenuItem(&mi, &gmp);

		mi.position = 500002;
		mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
		mi.name.a = LPGEN("Hide &offline users out here");
		hHideOfflineUsersOutHereMenuItem = Menu_AddGroupMenuItem(&mi);
		CreateServiceFunction(mi.pszService, HideOfflineRootHelper);

		mi.position = 500003;
		mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
		mi.name.a = LPGEN("Hide &empty groups");
		hHideEmptyGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
		CreateServiceFunction(mi.pszService, HideGroupsHelper);

		mi.position = 500004;
		mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
		mi.name.a = LPGEN("Disable &groups");
		hDisableGroupsMenuItem = Menu_AddGroupMenuItem(&mi);
		CreateServiceFunction(mi.pszService, UseGroupsHelper);

		mi.position = 1900000;
		mi.pszService = "CloseAction";
		mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
		mi.name.a = LPGEN("E&xit");
		Menu_AddGroupMenuItem(&mi);
	}

	// SubGroup menu
	CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
	CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
	CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService", SubGroupMenuCheckService);
	CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);

	hEventPreBuildSubGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
	HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);

	hSubGroupMenuObject = Menu_AddObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
	Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE);
	Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
	Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_CHECK_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuCheckService");
	{
		CMenuItem mi;
		mi.position = 1000;
		mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_ADD);
		mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
		mi.name.a = LPGEN("&New subgroup");
		gmp.wParam = POPUP_NEWSUBGROUP;
		Menu_AddSubGroupMenuItem(&mi, &gmp);

		mi.position = 1001;
		mi.hIcolibItem = 0;
		mi.name.a = LPGEN("&Hide offline users in here");
		gmp.wParam = POPUP_GROUPHIDEOFFLINE;
		hHideOfflineUsersHereMenuItem = Menu_AddSubGroupMenuItem(&mi, &gmp);

		mi.position = 900001;
		mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
		mi.name.a = LPGEN("&Rename group");
		gmp.wParam = POPUP_RENAMEGROUP;
		Menu_AddSubGroupMenuItem(&mi, &gmp);

		mi.position = 900002;
		mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
		mi.name.a = LPGEN("&Delete group");
		gmp.wParam = POPUP_DELETEGROUP;
		Menu_AddSubGroupMenuItem(&mi, &gmp);
	}
}