void InitIcons() { Icon_Register(hInst, SECT_TOLBAR, iconList, 2); Icon_Register(hInst, SECT_POPUP, iconList + 2, 5); Icon_Register(hInst, SECT_POPUP SECT_POPUP_OPT, iconList + 7, 9); Icon_Register(hInst, SECT_POPUP SECT_POPUP_ACT, iconList + 16, 9); }
extern "C" __declspec(dllexport) int Load() { mir_getLP(&pluginInfo); // Hook event to load messages and show first one HookEvent(ME_SYSTEM_MODULESLOADED, MainInit); HookEvent(ME_SYSTEM_PRESHUTDOWN, MainUninit); // Options InitOptions(); if (Skin_GetIcon("LISTENING_TO_ICON") == NULL) Icon_Register(hInst, LPGEN("Contact list"), iconList, 1); Icon_Register(hInst, LPGEN("My details"), iconList + 1, SIZEOF(iconList) - 1); // Register services CreateServiceFunction(MS_MYDETAILS_SETMYNICKNAME, PluginCommand_SetMyNickname); CreateServiceFunction(MS_MYDETAILS_SETMYNICKNAMEUI, PluginCommand_SetMyNicknameUI); CreateServiceFunction(MS_MYDETAILS_SETMYAVATAR, PluginCommand_SetMyAvatar); CreateServiceFunction(MS_MYDETAILS_SETMYAVATARUI, PluginCommand_SetMyAvatarUI); CreateServiceFunction(MS_MYDETAILS_GETMYNICKNAME, PluginCommand_GetMyNickname); CreateServiceFunction(MS_MYDETAILS_GETMYAVATAR, PluginCommand_GetMyAvatar); CreateServiceFunction(MS_MYDETAILS_SETMYSTATUSMESSAGEUI, PluginCommand_SetMyStatusMessageUI); CreateServiceFunction(MS_MYDETAILS_SHOWNEXTPROTOCOL, PluginCommand_ShowNextProtocol); CreateServiceFunction(MS_MYDETAILS_SHOWPREVIOUSPROTOCOL, PluginCommand_ShowPreviousProtocol); CreateServiceFunction(MS_MYDETAILS_SHOWPROTOCOL, PluginCommand_ShowProtocol); CreateServiceFunction(MS_MYDETAILS_CYCLE_THROUGH_PROTOCOLS, PluginCommand_CycleThroughtProtocols); return 0; }
void g_IconsInit() { Icon_Register(hInst, LPGEN("Protocols")"/"LPGEN("Jabber"), sharedIconList1, SIZEOF(sharedIconList1), GLOBAL_SETTING_PREFIX); Icon_Register(hInst, LPGEN("Protocols")"/"LPGEN("Jabber")"/"LPGEN("Dialogs"), sharedIconList2, SIZEOF(sharedIconList2), GLOBAL_SETTING_PREFIX); Icon_Register(hInst, LPGEN("Protocols")"/"LPGEN("Dialogs")"/"LPGEN("Discovery"), sharedIconList3, SIZEOF(sharedIconList3), GLOBAL_SETTING_PREFIX); Icon_Register(hInst, LPGEN("Protocols")"/"LPGEN("Dialogs")"/"LPGEN("Privacy"), sharedIconList4, SIZEOF(sharedIconList4), GLOBAL_SETTING_PREFIX); }
// Hook called after init static int MainInit(WPARAM wparam,LPARAM lparam) { InitProtocolData(); // Add options to menu CLISTMENUITEM mi = { sizeof(mi) }; mi.popupPosition = 500050000; mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_USERDETAILS); mi.ptszName = LPGENT("My Details"); HANDLE hMenuRoot = Menu_AddMainMenuItem(&mi); mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR; mi.ptszPopupName = (TCHAR *)hMenuRoot; mi.popupPosition = 0; mi.icolibItem = NULL; if (protocols->CanSetAvatars()) { mi.position = 100001; mi.ptszName = LPGENT("Set My Avatar..."); CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYAVATARUI, Menu_SetMyAvatarUI); mi.pszService = "MENU_" MS_MYDETAILS_SETMYAVATARUI; Menu_AddMainMenuItem(&mi); } mi.position = 100002; mi.ptszName = LPGENT("Set My Nickname..."); CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYNICKNAMEUI, Menu_SetMyNicknameUI); mi.pszService = "MENU_" MS_MYDETAILS_SETMYNICKNAMEUI; Menu_AddMainMenuItem(&mi); mi.position = 100003; mi.ptszName = LPGENT("Set My Status Message..."); CreateServiceFunction("MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI, Menu_SetMyStatusMessageUI); mi.pszService = "MENU_" MS_MYDETAILS_SETMYSTATUSMESSAGEUI; Menu_AddMainMenuItem(&mi); // Set protocols to show frame mi.position = 200001; mi.ptszName = LPGENT("Show next account"); mi.pszService = MS_MYDETAILS_SHOWNEXTPROTOCOL; Menu_AddMainMenuItem(&mi); InitFrames(); if ( Skin_GetIcon("LISTENING_TO_ICON") == NULL) Icon_Register(hInst, LPGEN("Contact List"), iconList, 1); Icon_Register(hInst, LPGEN("My Details"), iconList+1, SIZEOF(iconList)-1); return 0; }
void LoadExtraIconsModule() { DWORD ret = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS2, 0); clistFirstSlot = HIWORD(ret); clistSlotCount = LOWORD(ret); // Services CreateServiceFunction(MS_EXTRAICON_REGISTER, &ExtraIcon_Register); CreateServiceFunction(MS_EXTRAICON_SET_ICON, &ExtraIcon_SetIcon); CreateServiceFunction(MS_EXTRAICON_SET_ICON_BY_NAME, &ExtraIcon_SetIconByName); CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, &svcExtraIcon_Add); hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK); hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY); hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD); // Icons Icon_Register(NULL, "Contact List", iconList, SIZEOF(iconList)); // Hooks HookEvent(ME_SYSTEM_MODULESLOADED, &ModulesLoaded); HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, &ClistExtraListRebuild); HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &ClistExtraImageApply); HookEvent(ME_CLIST_EXTRA_CLICK, &ClistExtraClick); DefaultExtraIcons_Load(); }
void IsMenu() { if (MenuItem == 1) { Icon_Register(hInst, MENU_NAME, iconList, SIZEOF(iconList), MENU_NAME); InitMenu(); } }
extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); use_raw_ping = false; db_set_b(0, PLUG, "UsingRawSockets", (BYTE)use_raw_ping); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0); hWakeEvent = CreateEvent(NULL, FALSE, FALSE, _T("Local\\ThreadWaitEvent")); // create services before loading options - so we can have the 'getlogfilename' service! CreatePluginServices(); LoadOptions(); SkinAddNewSound("PingTimeout", "Ping Timout", 0); SkinAddNewSound("PingReply", "Ping Reply", 0); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_OPT_INITIALISE, PingOptInit); HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown); Icon_Register(hInst, LPGEN("Ping"), iconList, _countof(iconList)); HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons); return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); g_wMaskAdv = db_get_w(NULL,MOD_NAME,"optsmaskadv",0); g_bOldSetting = db_get_b(NULL, MOD_NAME, "OldSetting", 0); if ((g_bOldSetting & OLD_POPUP) && !(g_wMaskAdv & OPT_RESTORE)) // Restore popup settings if Miranda was crushed or killed in hidden mode and "Restore hiding on startup after failure" option is disabled { if (db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) == 0) db_set_b(NULL, "Popup", "ModuleIsEnabled", 1); if (db_get_b(NULL, "YAPP", "Enabled", 1) == 0) db_set_b(NULL, "YAPP", "Enabled", 1); } if (g_wMaskAdv & OPT_HIDEONSTART && db_get_b(NULL, "Popup", "ModuleIsEnabled", 0)) // hack for disabling popup on startup if "Hide Miranda on startup" is enabled { g_bOldSetting |= OLD_POPUP; db_set_b(NULL, "Popup", "ModuleIsEnabled", 0); } Icon_Register(g_hInstance, "BossKey", iconList, SIZEOF(iconList)); g_hHideService = CreateServiceFunction(MS_BOSSKEY_HIDE,BossKeyHideMiranda); // Create service HookEvent(ME_SYSTEM_MODULESLOADED,MirandaLoaded); return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded); Icon_Register(g_hInstance, MOD_NAME, iconList, _countof(iconList), "nas"); InitCommonControls(); InitOptions(); // must be called before we hook CallService if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { // change all %nas_message% variables to %extratext% if it wasn't done before TCString Str = db_get_s(NULL, MOD_NAME, "PopupsFormat", _T("")); if (Str.GetLen()) db_set_ts(NULL, MOD_NAME, "PopupsFormat", Str.Replace(_T("nas_message"), _T("extratext"))); Str = db_get_s(NULL, MOD_NAME, "ReplyPrefix", _T("")); if (Str.GetLen()) db_set_ts(NULL, MOD_NAME, "ReplyPrefix", Str.Replace(_T("nas_message"), _T("extratext"))); } if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 2) { // disable autoreply for not-on-list contacts, as such contact may be a spam bot db_set_b(NULL, MOD_NAME, ContactStatusToDBSetting(0, DB_ENABLEREPLY, 0, INVALID_CONTACT_ID), 0); db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 2); } return 0; }
void LoadExtraIconsModule() { DWORD ret = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS2, 0); clistFirstSlot = HIWORD(ret); clistSlotCount = LOWORD(ret); // Services CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, svcExtraIcon_Add); hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK); hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY); hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD); // Icons Icon_Register(g_hInst, LPGEN("Contact list"), iconList, _countof(iconList)); // Hooks HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, ClistExtraListRebuild); HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ClistExtraImageApply); HookEvent(ME_CLIST_EXTRA_CLICK, ClistExtraClick); DefaultExtraIcons_Load(); }
int OnModulesLoaded(WPARAM, LPARAM) { HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); if (ServiceExists(MS_BB_ADDBUTTON)) { Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, _countof(iconList)); BBButton bbd = { 0 }; bbd.cbSize = sizeof(BBButton); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON; bbd.pszModuleName = "Switch Layout and Send"; bbd.ptszTooltip = TranslateT("Switch Layout and Send"); bbd.hIcon = iconList[0].hIcolib; bbd.dwButtonID = 1; bbd.dwDefPos = 30; CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); bbd.pszModuleName = "Translit and Send"; bbd.ptszTooltip = TranslateT("Translit and Send"); bbd.hIcon = iconList[1].hIcolib; bbd.dwButtonID = 1; bbd.dwDefPos = 40; CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); bbd.pszModuleName = "Invert Case and Send"; bbd.ptszTooltip = TranslateT("Invert Case and Send"); bbd.hIcon = iconList[2].hIcolib; bbd.dwButtonID = 1; bbd.dwDefPos = 50; CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); } return 0; }
int LoadFavoriteContactMenu() { Icon_Register(g_hInst, LPGEN("Contact list"), iconList, _countof(iconList)); CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate); CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline); HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild); CMenuItem mi; SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc); mi.name.t = FAVMENUROOTNAME; mi.flags = CMIF_TCHAR; hFavoriteContactMenu = Menu_AddContactMenuItem(&mi); Menu_ConfigureItem(hFavoriteContactMenu, MCI_OPT_UNIQUENAME, "ModernClistMenu_ContactRate"); UNSET_UID(mi); mi.root = hFavoriteContactMenu; mi.flags = CMIF_TCHAR | CMIF_SYSTEM; // not included into new menu settings mi.pszService = CLUI_FAVSETRATE; for (int i = 0; i < _countof(rates); i++) { mi.hIcolibItem = iconList[i].hIcolib; mi.name.t = rates[i]; hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi); Menu_ConfigureItem(hFavoriteContactMenuItems[i], MCI_OPT_EXECPARAM, i); } mi.hIcolibItem = NULL; mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE; mi.position = -100000000; mi.name.t = LPGENT("Show even if offline"); hShowIfOflineItem = Menu_AddContactMenuItem(&mi); Menu_ConfigureItem(hShowIfOflineItem, MCI_OPT_EXECPARAM, _countof(rates) + 100000000); return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getXI(&xi); mir_getLP(&pluginInfo); Icon_Register(hInst, LPGEN("Paste It"), &icon, 1); NETLIBUSER nlu = {0}; nlu.cbSize = sizeof(nlu); nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_HTTPCONNS; nlu.szSettingsModule = MODULE; nlu.ptszDescriptiveName = TranslateT("Paste It HTTP connections"); g_hNetlibUser = ( HANDLE )CallService(MS_NETLIB_REGISTERUSER, 0, ( LPARAM )&nlu ); pasteToWebs[0] = new PasteToWeb1(); pasteToWebs[0]->pageIndex = 0; pasteToWebs[1] = new PasteToWeb2(); pasteToWebs[1]->pageIndex = 1; Options::instance = new Options(); pasteToWebs[0]->ConfigureSettings(); pasteToWebs[1]->ConfigureSettings(); Options::instance->Load(); hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); hOptionsInit = HookEvent(ME_OPT_INITIALISE, Options::InitOptions); hTabsrmmButtonPressed = NULL; hServiceContactMenu = CreateServiceFunction(MS_PASTEIT_CONTACTMENU, ContactMenuService); contactWindows = new std::map<MCONTACT, HWND>(); return 0; }
extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); InitCRC32(); Icon_Register(hInst, "fileAsMessage", iconList, SIZEOF(iconList)); hFileList = WindowList_Create(); CreateServiceFunction(SERVICE_NAME PSR_MESSAGE, OnRecvMessage); CreateServiceFunction(SERVICE_NAME "/FESendFile", OnSendFile); CreateServiceFunction(SERVICE_NAME "/FERecvFile", OnRecvFile); PROTOCOLDESCRIPTOR pd = { sizeof(pd) }; pd.szName = SERVICE_NAME; pd.type = PROTOTYPE_FILTER; CallService(MS_PROTO_REGISTERMODULE, 0, ( LPARAM ) &pd); HookEvent(ME_OPT_INITIALISE, OnOptInitialise); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); hHookDbSettingChange = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged); hHookSkinIconsChanged = NULL; return 0; }
// Initializes the services provided and the link to those needed // Called when the plugin is loaded into Miranda int LoadMetacontacts(void) { Icon_Register(g_hInst, LPGEN("MetaContacts"), iconList, _countof(iconList), "mc"); db_set_resident(META_PROTO, "Status"); db_set_resident(META_PROTO, "IdleTS"); //set all contacts to 'offline', and initialize subcontact counter for db consistency check for (MCONTACT hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) { db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE); db_set_dw(hContact, META_PROTO, "IdleTS", 0); } Meta_ReadOptions(); PROTOCOLDESCRIPTOR pd = { 0 }; pd.cbSize = sizeof(pd); pd.szName = META_FILTER; pd.type = PROTOTYPE_FILTER; Proto_RegisterModule(&pd); pd.szName = META_PROTO; pd.type = PROTOTYPE_VIRTUAL; Proto_RegisterModule(&pd); // further db setup done in modules loaded (nick [protocol string required] & clist display name) Meta_InitServices(); return 0; }
void InitIcons() { Icon_Register(hInst, LPGEN("No History"), iconList, SIZEOF(iconList), MODULE); ReloadIcons(0, 0); HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons); }
int LoadFavoriteContactMenu() { Icon_Register(g_hInst, LPGEN("Contact list"), iconList, SIZEOF(iconList)); CreateServiceFunction(CLUI_FAVSETRATE, FAV_SetRate); CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE, FAV_ToggleShowOffline); hOnContactMenuBuild_FAV = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, FAV_OnContactMenuBuild); return 0; }
extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); Icon_Register(hInst, "Console", iconList, _countof(iconList)); InitCommonControls(); InitConsole(); return 0; }
extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); CreateServiceFunction(MS_SESSIONS_SHOWFAVORITESMENU, BuildFavMenu); CreateServiceFunction(MS_SESSIONS_OPENMANAGER, OpenSessionsManagerWindow); CreateServiceFunction(MS_SESSIONS_RESTORELASTSESSION, LoadLastSession/*LoadSession*/); CreateServiceFunction(MS_SESSIONS_SAVEUSERSESSION, SaveUserSessionHandles); CreateServiceFunction(MS_SESSIONS_CLOSESESSION, CloseCurrentSession); HANDLE hEvent = CreateEvent(NULL, TRUE, TRUE, NULL); if (hEvent != 0) { CreateServiceFunction(MS_SESSIONS_LAUNCHME, LaunchSessions); CallService(MS_SYSTEM_WAITONHANDLE, (WPARAM)hEvent, (LPARAM)MS_SESSIONS_LAUNCHME); } g_ses_count = db_get_b(0, MODNAME, "UserSessionsCount", 0); if (!g_ses_count) g_ses_count = db_get_b(0, "Sessions (Unicode)", "UserSessionsCount", 0); g_ses_limit = db_get_b(0, MODNAME, "TrackCount", 10); g_bExclHidden = db_get_b(NULL, MODNAME, "ExclHidden", 0) != 0; g_bWarnOnHidden = db_get_b(NULL, MODNAME, "WarnOnHidden", 0) != 0; g_bOtherWarnings = db_get_b(NULL, MODNAME, "OtherWarnings", 1) != 0; g_bCrashRecovery = db_get_b(NULL, MODNAME, "CrashRecovery", 0) != 0; if (g_bCrashRecovery) g_bIncompletedSave = !db_get_b(NULL, MODNAME, "lastSaveCompleted", 0) != 0; if (g_bIncompletedSave) { int i = 0; memset(session_list_recovered, 0, sizeof(session_list_recovered)); for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) if (db_get_b(hContact, MODNAME, "wasInLastSession", 0)) session_list_recovered[i++] = hContact; } if (!session_list_recovered[0]) g_bIncompletedSave = FALSE; db_set_b(NULL, MODNAME, "lastSaveCompleted", 0); if (!db_get_b(NULL, MODNAME, "lastempty", 1) || g_bIncompletedSave) isLastTRUE = TRUE; HookEvent(ME_SYSTEM_MODULESLOADED, PluginInit); HookEvent(ME_SYSTEM_OKTOEXIT, OkToExit); HookEvent(ME_SYSTEM_PRESHUTDOWN, SessionPreShutdown); // Icons Icon_Register(g_hInst, MODNAME, iconList, _countof(iconList)); return 0; }
extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown); HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad); Icon_Register(g_hInstance, LPGEN("Database")"/"LPGEN("Database backups"), iconList, _countof(iconList)); return 0; }
int ModulesLoaded(WPARAM wParam, LPARAM lParam) { HookEvent(ME_POPUP_FILTER, DisablePopup); hTTBarloaded = HookEvent(ME_TTB_MODULELOADED, CreateTTButtons); if (TTBButtons == 1 && hTTBarloaded != NULL) { Icon_Register(hInst, "Toolbar/"MENU_NAME, iconttbList, SIZEOF(iconttbList), MENU_NAME); RemoveTTButtons(); CreateTTButtons(0,0); } return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); mir_getCLI(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnSettingChanged); Icon_Register(hInst, ModuleName, iconList, _countof(iconList)); return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); //IcoLib support Icon_Register(g_hInst, LPGEN("Ignore State"), iconList, _countof(iconList)); hExtraIcon = ExtraIcon_RegisterIcolib("ignore", LPGEN("Ignore State"), "ignore_full"); 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; }
int onModulesLoaded(WPARAM wParam,LPARAM lParam) { // IcoLib support Icon_Register(g_hInst, "Mobile State", &icon, 1); // Extra icons hExtraIcon = ExtraIcon_Register("mobilestate", LPGEN("Mobile State"), "mobile_icon"); // Set initial value for all contacts for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) ExtraIconsApply(hContact, 1); return 0; }
int ModulesLoaded(WPARAM wParam, LPARAM lParam) { LPCTSTR ptszEmptySting = _T(""); // Заполняем конфигурационные строки из базы. Если их там нет - генерируем. for (int i = 0; i < bLayNum; i++) { LPTSTR ptszCurrLayout = GenerateLayoutString(hklLayouts[i]); LPSTR ptszTemp = GetNameOfLayout(hklLayouts[i]); ptrT tszValue(db_get_tsa(NULL, ModuleName, ptszTemp)); if (tszValue == 0) ptszLayStrings[i] = ptszCurrLayout; else if (!_tcscmp(tszValue, ptszEmptySting)) ptszLayStrings[i] = ptszCurrLayout; else { ptszLayStrings[i] = tszValue.detouch(); if (!_tcscmp(ptszCurrLayout, ptszLayStrings[i])) db_unset(NULL, ModuleName, ptszTemp); mir_free(ptszCurrLayout); } mir_free(ptszTemp); } // Прочитаем основные настройки ReadMainOptions(); // Прочитаем настройки попапов ReadPopupOptions(); // Зарегим звук SkinAddNewSoundEx(SND_ChangeLayout, ModuleName, LPGEN("Changing Layout")); SkinAddNewSoundEx(SND_ChangeCase, ModuleName, LPGEN("Changing Case")); // Хук на нажатие клавиши kbHook_All = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)Keyboard_Hook, NULL, GetCurrentThreadId()); hChangeLayout = CreateServiceFunction(MS_CKL_CHANGELAYOUT, APIChangeLayout); hGetLayoutOfText = CreateServiceFunction(MS_CKL_GETLAYOUTOFTEXT, APIGetLayoutOfText); hChangeTextLayout = CreateServiceFunction(MS_CKL_CHANGETEXTLAYOUT, APIChangeTextLayout); // IcoLib support Icon_Register(hInst, ModuleName, iconList, SIZEOF(iconList)); HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged); OnIconsChanged(0, 0); RegPopupActions(); db_set_dw(NULL, ModuleName, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM)); return 0; }
int LoadVarModule() { if (initTokenRegister() != 0 || initContactModule() != 0) return -1; setParseOptions(NULL); hFormatStringService = CreateServiceFunction(MS_VARS_FORMATSTRING, formatStringService); hRegisterVariableService = CreateServiceFunction(MS_VARS_REGISTERTOKEN, registerToken); // help dialog hCurSplitNS = LoadCursor(NULL, IDC_SIZENS); hShowHelpService = CreateServiceFunction(MS_VARS_SHOWHELP, showHelpService); hShowHelpExService = CreateServiceFunction(MS_VARS_SHOWHELPEX, showHelpExService); Icon_Register(hInst, LPGEN("Variables"), &icon, 1); hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, iconsChanged); hGetIconService = CreateServiceFunction(MS_VARS_GETSKINITEM, getSkinItemService); hOptionsHook = HookEvent(ME_OPT_INITIALISE, OptionsInit); // register internal tokens registerExternalTokens(); registerLogicTokens(); registerMathTokens(); registerMirandaTokens(); registerStrTokens(); registerSystemTokens(); registerVariablesTokens(); registerRegExpTokens(); registerInetTokens(); registerAliasTokens(); registerMetaContactsTokens(); log_debugA("Variables: Internal tokens registered"); if (db_get_b(NULL, MODULENAME, SETTING_PARSEATSTARTUP, 0)) { FORMATINFO fi = { 0 }; fi.cbSize = sizeof(fi); fi.tszFormat = db_get_tsa(NULL, MODULENAME, SETTING_STARTUPTEXT); if (fi.tszFormat != NULL) { mir_free(formatString(&fi)); mir_free(fi.tszFormat); } } log_debugA("Variables: Init done"); return 0; }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ExtraIconsApply); // IcoLib support Icon_Register(g_hInst, "Mobile State", &icon, 1); // Extra icons hExtraIcon = ExtraIcon_RegisterIcolib("mobilestate", LPGEN("Mobile State"), "mobile_icon"); return 0; }
void IcoLib_LoadModule() { Icon_Register(ghInst, SECT_COMMON, &main, 1); LPTSTR szDefaultFile = IcoLib_GetDefaultIconFileName(); IcoLib_CheckIconPackVersion(szDefaultFile); // load default icon if required ghDefIcon = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_DEFAULT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); for (int i = 0; i < _countof(icoDesc); i++) IcoLib_RegisterIconHandleEx( icoDesc[i].pszName, icoDesc[i].pszDesc, icoDesc[i].pszSection, szDefaultFile, icoDesc[i].idResource, icoDesc[i].size, ghDefIcon); }
int onModulesLoaded(WPARAM wParam,LPARAM lParam) { HookEvent(ME_OPT_INITIALISE, onOptInitialise); //IcoLib support Icon_Register(g_hInst, LPGEN("Ignore State"), iconList, SIZEOF(iconList)); fill_filter(); hExtraIcon = ExtraIcon_Register("ignore", LPGEN("Ignore State"), "ignore_full"); // Set initial value for all contacts for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) applyExtraImage(hContact); return 0; }