//menu //Function which makes the initializations static int ModulesLoaded(WPARAM,LPARAM) { //check if History++ is installed gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) && (CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112)); //check if MText plugin is installed if (MText.Register) { htuText = MText.Register("Popup Plus/Text", MTEXT_FANCY_DEFAULT); htuTitle = MText.Register("Popup Plus/Title",MTEXT_FANCY_DEFAULT); } else htuTitle = htuText = NULL; // init meta contacts INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0); if (ptr != CALLSERVICE_NOTFOUND) gszMetaProto = (LPCSTR)ptr; //check if OptionLoaded if (!OptionLoaded) LoadOptions(); //Uninstalling purposes if (ServiceExists("PluginSweeper/Add")) CallService("PluginSweeper/Add", (WPARAM)Translate(MODULNAME), (LPARAM)MODULNAME); //load fonts / create hook InitFonts(); HookEvent(ME_FONT_RELOAD, FontsChanged); //load actions and notifications LoadActions(); LoadNotifications(); //hook TopToolBar HookEvent(ME_TTB_MODULELOADED, TTBLoaded); //Folder plugin support folderId = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Popup Plus"), MIRANDA_PATHT _T("\\Skins\\Popup")); //load skin skins.load(_T("dir")); const PopupSkin *skin; if (skin = skins.getSkin(PopupOptions.SkinPack)) { mir_free(PopupOptions.SkinPack); PopupOptions.SkinPack = mir_tstrdup(skin->getName()); skin->loadOpts(); } //init PopupEfects PopupEfectsInitialize(); //MessageAPI support SrmmMenu_Load(); //Hotkey LoadHotkey(); gbPopupLoaded = TRUE; return 0; }
int ModulesLoaded(WPARAM wParam, LPARAM lParam) { // create contact menu item CMenuItem mi; mi.flags = CMIF_TCHAR; mi.position = -300010; mi.name.t = LPGENT("Disable History"); mi.pszService = MS_NOHISTORY_TOGGLE; mi.hIcolibItem = hIconRemove; hMenuToggle = Menu_AddContactMenuItem(&mi); mi.position = -300005; mi.name.t = LPGENT("Clear History"); mi.pszService = MS_NOHISTORY_CLEAR; mi.hIcolibItem = hIconClear; hMenuClear = Menu_AddContactMenuItem(&mi); // add icon to srmm status icons SrmmMenu_Load(); return 0; }
int ModulesLoaded(WPARAM, LPARAM) { // create contact menu item CMenuItem mi; mi.flags = CMIF_TCHAR; SET_UID(mi, 0xede12697, 0x3e9d, 0x47ca, 0x83, 0xe0, 0xc1, 0x40, 0x69, 0xbf, 0x2d, 0xab); mi.position = -300010; mi.name.t = LPGENT("Disable History"); mi.pszService = MS_NOHISTORY_TOGGLE; mi.hIcolibItem = hIconRemove; hMenuToggle = Menu_AddContactMenuItem(&mi); SET_UID(mi, 0x1c4b1c21, 0xc0d1, 0x44d1, 0xb5, 0x3c, 0xc7, 0x8d, 0xcf, 0x96, 0x51, 0xd7); mi.position = -300005; mi.name.t = LPGENT("Clear History"); mi.pszService = MS_NOHISTORY_CLEAR; mi.hIcolibItem = hIconClear; hMenuClear = Menu_AddContactMenuItem(&mi); // add icon to srmm status icons SrmmMenu_Load(); return 0; }
//menu //Function which makes the initializations static int ModulesLoaded(WPARAM wParam,LPARAM lParam) { //check if 'Icon Library Manager' and 'FontService' exist (load icon and font later) if (!ServiceExists(MS_FONT_REGISTER) || !ServiceExists(MS_SKIN2_ADDICON)) { LPTSTR msg = TranslateTS( _T("This version of Popup Plus requires\r\n") _T("'Icon Library Manager' and 'FontService'\r\n") _T("modules.\r\n") _T("\r\n") _T("You always can download them at\r\n") _T("http://addons.miranda-im.org/\r\n") _T("\r\n") _T("Do you want to visit Miranda IM homepage now?\r\n") ); if (MessageBox(NULL, msg, _T("Popup Plus Error"), MB_YESNO|MB_ICONSTOP) == IDYES) ShellExecute(NULL, _T("open"), _T("http://addons.miranda-im.org/"), NULL, NULL, SW_SHOWNORMAL); return 0; } //check if History++ is installed gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) && (CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112)); //check if MText plugin is installed if (MText.Register) { htuText = MText.Register("PopUp Plus/Text", MTEXT_FANCY_DEFAULT); htuTitle = MText.Register("PopUp Plus/Title",MTEXT_FANCY_DEFAULT); } else { htuTitle = htuText = NULL; } // init meta contacts INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0); if (ptr != CALLSERVICE_NOTFOUND) { gszMetaProto = (LPCSTR)ptr; } //check if OptionLoaded if(!OptionLoaded){ LoadOptions(); } /*/deprecatet stuff notifyLink = ServiceExists(MS_NOTIFY_GETLINK) ? (MNOTIFYLINK *)CallService(MS_NOTIFY_GETLINK, 0, 0) : NULL; LoadNotifyImp(); hNotifyOptionsInitialize = HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize); HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInitialise); */ //Uninstalling purposes if (ServiceExists("PluginSweeper/Add")) { CallService("PluginSweeper/Add",(WPARAM)Translate(MODULNAME),(LPARAM)MODULNAME); } //load fonts / create hook InitFonts(); hFontsChanged = HookEvent(ME_FONT_RELOAD,FontsChanged); //load actions and notifications LoadActions(); LoadNotifications(); //hook TopToolBar hTTBLoaded = HookEvent(ME_TTB_MODULELOADED, TTBLoaded); //Folder plugin support LPTSTR pszPath = mir_a2t(MIRANDA_PATH "\\Skins\\PopUp"); folderId = FoldersRegisterCustomPathT(MODULNAME_LONG, "Skins", pszPath); mir_free(pszPath); //load skin skins.load(_T("dir")); const PopupSkin *skin; if (skin = skins.getSkin(PopUpOptions.SkinPack)) { mir_free(PopUpOptions.SkinPack); PopUpOptions.SkinPack = mir_tstrdup(skin->getName()); skin->loadOpts(); } //init PopupEfects PopupEfectsInitialize(); //MessageAPI support SrmmMenu_Load(); //Hotkey LoadHotkey(); //Modern Toolbar support if(ServiceExists(MS_TB_ADDBUTTON)) { hTBLoaded = HookEvent(ME_TB_MODULELOADED, ToolbarSet); ToolbarSet(0,0); } //Updater support if(ServiceExists(MS_UPDATE_REGISTER)) registerUpdate(); gbPopupLoaded = TRUE; return 0; }