/** * Hotkeys initialiation */ void FacebookProto::InitHotkeys() { char text[200]; strcpy(text, m_szModuleName); char* tDest = text + strlen(text); HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = text; hkd.pszService = text; hkd.ptszSection = m_tszUserName; hkd.dwFlags = HKD_TCHAR; strcpy(tDest, "/VisitProfile"); hkd.ptszDescription = LPGENT("Visit profile"); Hotkey_Register(&hkd); strcpy(tDest, "/VisitNotifications"); hkd.ptszDescription = LPGENT("Visit notifications"); Hotkey_Register(&hkd); strcpy(tDest, "/Mind"); hkd.ptszDescription = LPGENT("Show 'Share status' window"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_EXT, 'F'); Hotkey_Register(&hkd); }
static int hotkeys_MakeHotkey(lua_State *L) { int mod = 0; switch (lua_type(L, 1)) { case LUA_TNUMBER: mod = luaL_checkinteger(L, 1); break; case LUA_TSTRING: mod = (1 << (luaL_checkoption(L, 1, NULL, mods) - 1)); break; case LUA_TTABLE: lua_pushnil(L); while (lua_next(L, 1) != 0) { mod |= (1 << (luaL_checkoption(L, -1, NULL, mods) - 1)); lua_pop(L, 1); } break; default: luaL_argerror(L, 1, luaL_typename(L, 1)); } int vk = luaL_checknumber(L, 2); WORD res = HOTKEYCODE(mod, vk); lua_pushinteger(L, res); return 1; }
static int lua_MakeHotkey(lua_State *L) { int mod = luaL_checkinteger(L, 1); int vk = luaL_checkinteger(L, 2); WORD res = HOTKEYCODE(mod, vk); lua_pushinteger(L, res); return 1; }
int ModulesLoaded(WPARAM wParam,LPARAM lParam) { // Register menu item CLISTMENUITEM mi = { sizeof(mi) }; mi.position = 1900000001; mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT)); mi.pszPopupName = "Database"; mi.pszName = modFullname; mi.pszService = "DBEditorpp/MenuCommand"; Menu_AddMainMenuItem(&mi); ZeroMemory(&mi, sizeof(mi)); mi.cbSize = sizeof(mi); mi.position = 1900000001; mi.flags = db_get_b(NULL, modname, "UserMenuItem", 0) ? 0 : CMIF_HIDDEN; mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGUSER)); mi.pszName = LPGEN("Open user tree in DBE++"); mi.pszService = "DBEditorpp/MenuCommand"; hUserMenu = Menu_AddContactMenuItem(&mi); // Register hotkeys HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "hk_dbepp_open"; hkd.pszService = "DBEditorpp/MenuCommand"; hkd.ptszDescription = LPGEN("Open Database Editor"); hkd.ptszSection = modFullname; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_EXT, 'D'); Hotkey_Register(&hkd); // icons TCHAR szModuleFileName[MAX_PATH]; if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH)) addIcons(szModuleFileName); UnhookEvent(hModulesLoadedHook); usePopups = db_get_b(NULL, modname, "UsePopUps", 0); // Load the name order for (int i = 0; i < NAMEORDERCOUNT; i++) nameOrder[i] = i; DBVARIANT dbv; if (!db_get(NULL, "Contact", "NameOrder", &dbv)) { CopyMemory(nameOrder, dbv.pbVal, dbv.cpbVal); db_free(&dbv); } HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); if (bServiceMode) CallService("DBEditorpp/MenuCommand", 0, 0); return 0; }
void RegisterHotkeys(char buf[200], wchar_t* accName, int Number) { HOTKEYDESC hotkey = {}; hotkey.dwFlags = HKD_UNICODE; hotkey.pszName = buf; hotkey.szDescription.w = accName; hotkey.szSection.w = LPGENW("Custom Status List"); hotkey.pszService = buf; hotkey.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, '0' + Number); g_plugin.addHotkey(&hotkey); }
void RegisterCoreHotKeys (void) { HOTKEYDESC hotkey = {0}; hotkey.cbSize = sizeof(HOTKEYDESC); hotkey.pszName = "Hide/Show Miranda"; hotkey.pszDescription = LPGEN("Hide/Show Miranda"); hotkey.pszSection = "BossKey"; hotkey.pszService = MS_BOSSKEY_HIDE; hotkey.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F12); Hotkey_Register(&hotkey); }
void AddHotkey() { HOTKEYDESC hkd = {0}; hkd.cbSize = sizeof(hkd); hkd.dwFlags = HKD_TCHAR; hkd.pszName = "AutoShutdown_Toggle"; hkd.ptszDescription = LPGENT("Toggle Automatic Shutdown"); hkd.ptszSection = LPGENT("Main"); hkd.pszService = "AutoShutdown/MenuCommand"; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'T') | HKF_MIRANDA_LOCAL; hkd.lParam = FALSE; Hotkey_Register(&hkd); }
int ModulesLoaded(WPARAM, LPARAM) { IcoLibRegister(); // Register menu item CMenuItem mi; mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Database"), 1900000001); SET_UID(mi, 0xe298849c, 0x1a8c, 0x4fc7, 0xa0, 0xf4, 0x78, 0x18, 0xf, 0xe2, 0xf7, 0xc9); mi.position = 1900000001; mi.hIcolibItem = GetIcoLibHandle(ICO_DBE_BUTT); mi.name.a = modFullname; mi.pszService = "DBEditorpp/MenuCommand"; Menu_AddMainMenuItem(&mi); SET_UID(mi, 0x2fed8613, 0xac43, 0x4148, 0xbd, 0x5c, 0x44, 0x88, 0xaf, 0x68, 0x69, 0x10); mi.root = NULL; mi.hIcolibItem = GetIcoLibHandle(ICO_REGUSER); mi.name.a = LPGEN("Open user tree in DBE++"); mi.pszService = "DBEditorpp/MenuCommand"; hUserMenu = Menu_AddContactMenuItem(&mi); // Register hotkeys _A2T text(modFullname); HOTKEYDESC hkd = { sizeof(hkd) }; hkd.dwFlags = HKD_TCHAR; hkd.pszName = "hk_dbepp_open"; hkd.pszService = "DBEditorpp/MenuCommand"; hkd.ptszDescription = LPGENT("Open Database Editor"); hkd.ptszSection = text; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_EXT, 'D'); Hotkey_Register(&hkd); g_bUsePopups = db_get_b(NULL, modname, "UsePopUps", 0) != 0; // Load the name order for (int i = 0; i < NAMEORDERCOUNT; i++) nameOrder[i] = i; DBVARIANT dbv = { 0 }; if (!db_get_s(NULL, "Contact", "NameOrder", &dbv, DBVT_BLOB)) { memcpy(nameOrder, dbv.pbVal, dbv.cpbVal); db_free(&dbv); } HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); if (g_bServiceMode) CallService("DBEditorpp/MenuCommand", 0, 0); return 0; }
/** * Hotkeys initialiation */ void FacebookProto::InitHotkeys() { char module[512]; mir_snprintf(module, sizeof(module), "%s/Mind", m_szModuleName); HOTKEYDESC hkd = { sizeof(hkd) }; hkd.dwFlags = HKD_TCHAR; hkd.ptszDescription = LPGENT("Show 'Share status' window"); hkd.pszName = "ShowMindWnd"; hkd.ptszSection = m_tszUserName; hkd.pszService = module; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT|HOTKEYF_EXT, 'F'); Hotkey_Register(&hkd); }
static TCHAR *GetBossKeyText(void) { WORD wHotKey = db_get_w(NULL,"SkinHotKeys", "Hide/Show Miranda", HOTKEYCODE(HOTKEYF_CONTROL, VK_F12)); BYTE key = LOBYTE(wHotKey); BYTE shift = HIBYTE(wHotKey); static TCHAR buf[128] = {0}; mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s%s%s"), (shift & HOTKEYF_CONTROL) ? _T("Ctrl + ") : _T(""), (shift & HOTKEYF_SHIFT) ? _T("Shift + ") : _T(""), (shift & HOTKEYF_ALT) ? _T("Alt + ") : _T(""), (shift & HOTKEYF_EXT) ? _T("Win + ") : _T(""), HokeyVkToName(key)); return buf; }
extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); CreateServiceFunction(MS_TS_SWITCHLAYOUT, ServiceSwitch); CreateServiceFunction(MS_TS_TRANSLITLAYOUT, ServiceTranslit); CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown); HOTKEYDESC hkd = { sizeof(hkd) }; hkd.dwFlags = HKD_TCHAR; hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected"; hkd.ptszDescription = LPGENT("Convert All / Selected"); hkd.ptszSection = _T("TranslitSwitcher"); hkd.pszService = MS_TS_SWITCHLAYOUT; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL; Hotkey_Register(&hkd); hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected"; hkd.ptszDescription = LPGENT("Convert Last / Selected"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL; hkd.lParam = true; Hotkey_Register(&hkd); hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected"; hkd.ptszDescription = LPGENT("Translit All / Selected"); hkd.pszService = MS_TS_TRANSLITLAYOUT; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL; hkd.lParam = false; Hotkey_Register(&hkd); hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected"; hkd.ptszDescription = LPGENT("Translit Last / Selected"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL; hkd.lParam = true; Hotkey_Register(&hkd); hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected"; hkd.ptszDescription = LPGENT("Invert Case All / Selected"); hkd.pszService = MS_TS_INVERTCASE; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL; hkd.lParam = false; Hotkey_Register(&hkd); hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected"; hkd.ptszDescription = LPGENT("Invert Case Last / Selected"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT + HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL; hkd.lParam = true; Hotkey_Register(&hkd); return 0; }
int CMPlugin::Load() { // Add options hook HookEvent(ME_OPT_INITIALISE, OptInit); HookEvent(ME_SYSTEM_MODULESLOADED, NewsAggrInit); HookEvent(ME_SYSTEM_PRESHUTDOWN, NewsAggrPreShutdown); hUpdateMutex = CreateMutex(nullptr, FALSE, nullptr); CreateProtoServiceFunction(MODULENAME, PS_GETNAME, NewsAggrGetName); CreateProtoServiceFunction(MODULENAME, PS_GETCAPS, NewsAggrGetCaps); CreateProtoServiceFunction(MODULENAME, PS_SETSTATUS, NewsAggrSetStatus); CreateProtoServiceFunction(MODULENAME, PS_GETSTATUS, NewsAggrGetStatus); CreateProtoServiceFunction(MODULENAME, PS_LOADICON, NewsAggrLoadIcon); CreateProtoServiceFunction(MODULENAME, PSS_GETINFO, NewsAggrGetInfo); CreateProtoServiceFunction(MODULENAME, PS_GETAVATARINFO, NewsAggrGetAvatarInfo); CreateProtoServiceFunction(MODULENAME, PSR_MESSAGE, NewsAggrRecvMessage); CreateServiceFunction(MS_NEWSAGGREGATOR_CHECKALLFEEDS, CheckAllFeeds); CreateServiceFunction(MS_NEWSAGGREGATOR_ADDFEED, AddFeed); CreateServiceFunction(MS_NEWSAGGREGATOR_IMPORTFEEDS, ImportFeeds); CreateServiceFunction(MS_NEWSAGGREGATOR_EXPORTFEEDS, ExportFeeds); CreateServiceFunction(MS_NEWSAGGREGATOR_CHECKFEED, CheckFeed); CreateServiceFunction(MS_NEWSAGGREGATOR_CHANGEFEED, ChangeFeed); CreateServiceFunction(MS_NEWSAGGREGATOR_ENABLED, EnableDisable); HOTKEYDESC hkd = {}; hkd.dwFlags = HKD_UNICODE; hkd.pszName = "NewsAggregator/CheckAllFeeds"; hkd.szDescription.w = LPGENW("Check All Feeds"); hkd.szSection.w = LPGENW("News Aggregator"); hkd.pszService = MS_NEWSAGGREGATOR_CHECKALLFEEDS; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'O') | HKF_MIRANDA_LOCAL; g_plugin.addHotkey(&hkd); InitIcons(); return 0; }
int ModulesLoaded(WPARAM, LPARAM) { Silent = true; HOTKEYDESC hkd = { 0 }; hkd.cbSize = sizeof(hkd); hkd.dwFlags = HKD_TCHAR; hkd.pszName = "Check for pack updates"; hkd.ptszDescription = LPGENT("Check for pack updates"); hkd.ptszSection = LPGENT("Pack Updater"); hkd.pszService = MODNAME"/CheckUpdates"; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL; hkd.lParam = FALSE; Hotkey_Register(&hkd); if (AllowUpdateOnStartup()) DoCheck(UpdateOnStartup); Timer = CreateWaitableTimer(NULL, FALSE, NULL); InitTimer(); return 0; }
void InitCustomMenus(void) { CreateServiceFunction("MainMenuExecService", MainMenuExecService); CreateServiceFunction("ContactMenuExecService", ContactMenuExecService); CreateServiceFunction("ContactMenuCheckService", ContactMenuCheckService); CreateServiceFunction("StatusMenuExecService", StatusMenuExecService); CreateServiceFunction("StatusMenuCheckService", StatusMenuCheckService); //free services CreateServiceFunction("CLISTMENUS/FreeOwnerDataMainMenu", FreeOwnerDataMainMenu); CreateServiceFunction("CLISTMENUS/FreeOwnerDataContactMenu", FreeOwnerDataContactMenu); CreateServiceFunction("CLISTMENUS/FreeOwnerDataStatusMenu", FreeOwnerDataStatusMenu); CreateServiceFunction(MS_CLIST_SETSTATUSMODE, SetStatusMode); CreateServiceFunction("CList/AddMainMenuItem", AddMainMenuItem); CreateServiceFunction("CList/AddStatusMenuItem", AddStatusMenuItem); CreateServiceFunction(MS_CLIST_MENUGETMAIN, MenuGetMain); CreateServiceFunction(MS_CLIST_MENUBUILDMAIN, BuildMainMenu); CreateServiceFunction("CList/AddContactMenuItem", AddContactMenuItem); CreateServiceFunction(MS_CLIST_MENUBUILDCONTACT, BuildContactMenu); CreateServiceFunction(MS_CLIST_SHOWHIDEMENUITEM, ShowHideMenuItem); CreateServiceFunction(MS_CLIST_MODIFYMENUITEM, ModifyCustomMenuItem); CreateServiceFunction(MS_CLIST_MENUMEASUREITEM, MeasureMenuItem); CreateServiceFunction(MS_CLIST_MENUDRAWITEM, DrawMenuItem); CreateServiceFunction(MS_CLIST_MENUGETSTATUS, BuildStatusMenu); CreateServiceFunction(MS_CLIST_MENUPROCESSCOMMAND, MenuProcessCommand); CreateServiceFunction(MS_CLIST_MENUPROCESSHOTKEY, MenuProcessHotkey); CreateServiceFunction("CList/AddProtoMenuItem", AddProtoMenuItem); hPreBuildContactMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU); hPreBuildMainMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDMAINMENU); cli.hPreBuildStatusMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDSTATUSMENU); hStatusModeChangeEvent = CreateHookableEvent(ME_CLIST_STATUSMODECHANGE); HookEvent(ME_PROTO_ACK, MenuProtoAck); hMainMenu = CreatePopupMenu(); hStatusMenu = CreatePopupMenu(); hStatusMainMenuHandles = NULL; hStatusMainMenuHandlesCnt = 0; hStatusMenuHandles = NULL; hStatusMenuHandlesCnt = 0; // new menu sys InitGenMenu(); // main menu hMainMenuObject = MO_CreateMenuObject("MainMenu", LPGEN("Main menu"), 0, "MainMenuExecService"); MO_SetOptionsMenuObject(hMainMenuObject, OPT_USERDEFINEDITEMS, TRUE); MO_SetOptionsMenuObject(hMainMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, (INT_PTR)"CLISTMENUS/FreeOwnerDataMainMenu"); // contact menu hContactMenuObject = MO_CreateMenuObject("ContactMenu", LPGEN("Contact menu"), "ContactMenuCheckService", "ContactMenuExecService"); MO_SetOptionsMenuObject(hContactMenuObject, OPT_USERDEFINEDITEMS, TRUE); MO_SetOptionsMenuObject(hContactMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, (INT_PTR)"CLISTMENUS/FreeOwnerDataContactMenu"); // initialize hotkeys CreateServiceFunction(MS_CLIST_HKSTATUS, HotkeySetStatus); HOTKEYDESC hkd = { sizeof(hkd) }; hkd.ptszSection = _T("Status"); hkd.dwFlags = HKD_TCHAR; for (int i = 0; i < SIZEOF(statusHotkeys); i++) { char szName[30]; mir_snprintf(szName, SIZEOF(szName), "StatusHotKey_%d", i); hkd.pszName = szName; hkd.lParam = statusModeList[i]; hkd.ptszDescription = fnGetStatusModeDescription(hkd.lParam, 0); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, '0' + i) | HKF_MIRANDA_LOCAL; hkd.pszService = MS_CLIST_HKSTATUS; statusHotkeys[i] = Hotkey_Register(&hkd); } HookEvent(ME_HOTKEYS_CHANGED, sttRebuildHotkeys); // add exit command to menu CLISTMENUITEM mi = { sizeof(mi) }; mi.position = 0x7fffffff; mi.pszService = "CloseAction"; mi.pszName = LPGEN("E&xit"); mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_EXIT); AddMainMenuItem(0, (LPARAM)&mi); cli.currentStatusMenuItem = ID_STATUS_OFFLINE; cli.currentDesiredStatusMode = ID_STATUS_OFFLINE; HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged); }
extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); YAMN_STATUS = ID_STATUS_OFFLINE; // we get the Miranda Root Path PathToAbsoluteT( _T("."), szMirandaDir); // retrieve the current profile name CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(ProfileName), (LPARAM)ProfileName); //not to pass entire array to fcn TCHAR *fc = _tcsrchr(ProfileName, '.'); if ( fc != NULL ) *fc = 0; // we get the user path where our yamn-account.book.ini is stored from mirandaboot.ini file GetProfileDirectory(UserDirectory, _countof(UserDirectory)); // Enumerate all the code pages available for the System Locale EnumSystemCodePages(EnumSystemCodePagesProc, CP_INSTALLED); CodePageNamesSupp = new _tcptable[CPLENSUPP]; for (int i = 0, k = 0; i < CPLENALL; i++) { if (CodePageNamesAll[i].isValid) { CodePageNamesSupp[k] = CodePageNamesAll[i]; k++; } } // Registering YAMN as protocol PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; pd.szName = YAMN_DBMODULE; pd.type = PROTOTYPE_VIRTUAL; Proto_RegisterModule(&pd); InitializeCriticalSection(&AccountStatusCS); InitializeCriticalSection(&FileWritingCS); InitializeCriticalSection(&PluginRegCS); if (NULL == (NoWriterEV = CreateEvent(NULL, TRUE, TRUE, NULL))) return 1; if (NULL == (WriteToFileEV = CreateEvent(NULL, FALSE, FALSE, NULL))) return 1; if (NULL == (ExitEV = CreateEvent(NULL, TRUE, FALSE, NULL))) return 1; PosX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBPOSX, 0); PosY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBPOSY, 0); SizeX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBSIZEX, 800); SizeY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBSIZEY, 200); HeadPosX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSX, 0); HeadPosY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSY, 0); HeadSizeX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEX, 690); HeadSizeY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEY, 300); HeadSplitPos = db_get_w(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSSPLIT, 250); optDateTime = db_get_b(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime); // Create new window queues for broadcast messages YAMNVar.MessageWnds = WindowList_Create(); YAMNVar.NewMailAccountWnd = WindowList_Create(); YAMNVar.Shutdown = FALSE; hCurSplitNS = LoadCursor(NULL, IDC_SIZENS); hCurSplitWE = LoadCursor(NULL, IDC_SIZEWE); #ifdef _DEBUG InitDebug(); #endif CreateServiceFunctions(); SkinAddNewSoundEx(YAMN_NEWMAILSOUND, YAMN_DBMODULE, YAMN_NEWMAILSNDDESC); SkinAddNewSoundEx(YAMN_CONNECTFAILSOUND, YAMN_DBMODULE, YAMN_CONNECTFAILSNDDESC); HookEvents(); LoadIcons(); LoadPlugins(); HOTKEYDESC hkd = {0}; hkd.cbSize = sizeof(hkd); hkd.pszName = "YAMN_hotkey"; hkd.pszService = MS_YAMN_FORCECHECK; hkd.pszSection = YAMN_DBMODULE; hkd.pszDescription = LPGEN("Check mail"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F11); Hotkey_Register(&hkd); //Create thread that will be executed every second if (!(SecTimer = SetTimer(NULL, 0, 1000, TimerProc))) return 1; return 0; }
/* static INT_PTR hkCloseMiranda(WPARAM wParam,LPARAM lParam) { CallService("CloseAction", 0, 0); return 0; } INT_PTR hkRestoreStatus(WPARAM wParam,LPARAM lParam) { int nStatus = DBGetContactSettingWord(NULL, "CList", "Status", ID_STATUS_OFFLINE); CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0); return 0; } static INT_PTR hkAllOffline(WPARAM, LPARAM) { CallService(MS_CLIST_SETSTATUSMODE, ID_STATUS_OFFLINE, 0); return 0; } */ int InitClistHotKeys(void) { HOTKEYDESC shk = {0}; CreateServiceFunction("CLIST/HK/SHOWHIDE",hkHideShow); CreateServiceFunction("CLIST/HK/Opts",hkOpts); CreateServiceFunction("CLIST/HK/Read",hkRead); // CreateServiceFunction("CLIST/HK/CloseMiranda",hkCloseMiranda); // CreateServiceFunction("CLIST/HK/RestoreStatus",hkRestoreStatus); // CreateServiceFunction("CLIST/HK/AllOffline",hkAllOffline); shk.cbSize=sizeof(shk); shk.pszDescription="Show Hide Contact List"; shk.pszName="ShowHide"; shk.pszSection="Main"; shk.pszService="CLIST/HK/SHOWHIDE"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A'); CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); shk.pszDescription="Read Message"; shk.pszName="ReadMessage"; shk.pszSection="Main"; shk.pszService="CLIST/HK/Read"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I'); CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); /* shk.pszDescription="Search in site"; shk.pszName="SearchInWeb"; shk.pszSection="Main"; shk.pszService="CLIST/HK/Search"; shk.DefHotKey=846; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); */ shk.pszDescription = "Open Options Page"; shk.pszName = "ShowOptions"; shk.pszSection = "Main"; shk.pszService = "CLIST/HK/Opts"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); shk.pszDescription = "Open Logging Options"; shk.pszName = "ShowLogOptions"; shk.pszSection = "Main"; shk.pszService = "Netlib/Log/Win"; shk.DefHotKey = 0; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); shk.pszDescription="Open Find User Dialog"; shk.pszName="FindUsers"; shk.pszSection="Main"; shk.pszService="FindAdd/FindAddCommand"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); /* shk.pszDescription="Close Miranda"; shk.pszName="CloseMiranda"; shk.pszSection="Main"; shk.pszService="CLIST/HK/CloseMiranda"; shk.DefHotKey=0; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); shk.pszDescription="Restore last status"; shk.pszName="RestoreLastStatus"; shk.pszSection="Status"; shk.pszService="CLIST/HK/RestoreStatus"; shk.DefHotKey=0; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); shk.pszDescription="Set All Offline"; shk.pszName="AllOffline"; shk.pszSection="Status"; shk.pszService="CLIST/HK/AllOffline"; shk.DefHotKey=0; CallService(MS_HOTKEY_REGISTER,0,(LPARAM)&shk); */ return 0; }
int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { HICON hSwitchIcon = NULL, hTranslitIcon = NULL, hInvertIcon = NULL; HOTKEYDESC hkd = {0}; hkd.cbSize = sizeof(hkd); hkd.dwFlags = HKD_TCHAR; hService = CreateServiceFunction(MS_TS_SWITCHLAYOUT, ServiceSwitch); hService2 = CreateServiceFunction(MS_TS_TRANSLITLAYOUT, ServiceTranslit); hService3 = CreateServiceFunction(MS_TS_INVERTCASE, ServiceInvert); hkd.pszName = "TranslitSwitcher/ConvertAllOrSelected"; hkd.ptszDescription = _T("Convert All / Selected"); hkd.ptszSection = _T("TranslitSwitcher"); hkd.pszService = MS_TS_SWITCHLAYOUT; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL; hkd.lParam = FALSE; CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd); hkd.pszName = "TranslitSwitcher/ConvertLastOrSelected"; hkd.ptszDescription = _T("Convert Last / Selected"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'R') | HKF_MIRANDA_LOCAL; hkd.lParam = TRUE; CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd); hkd.pszName = "TranslitSwitcher/TranslitAllOrSelected"; hkd.ptszDescription = _T("Translit All / Selected"); hkd.pszService = MS_TS_TRANSLITLAYOUT; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL; hkd.lParam = FALSE; CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd); hkd.pszName = "TranslitSwitcher/TranslitLastOrSelected"; hkd.ptszDescription = _T("Translit Last / Selected"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'T') | HKF_MIRANDA_LOCAL; hkd.lParam = TRUE; CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd); hkd.pszName = "TranslitSwitcher/InvertCaseAllOrSelected"; hkd.ptszDescription = _T("Invert Case All / Selected"); hkd.pszService = MS_TS_INVERTCASE; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL+HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL; hkd.lParam = FALSE; CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd); hkd.pszName = "TranslitSwitcher/InvertCaseLastOrSelected"; hkd.ptszDescription = _T("Invert Case Last / Selected"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_ALT+HKCOMB_A, 'Y') | HKF_MIRANDA_LOCAL; hkd.lParam = TRUE; CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hkd); hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed); if (ServiceExists(MS_BB_ADDBUTTON) && ServiceExists(MS_SKIN2_ADDICON)) { SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.flags = SIDF_TCHAR; sid.ptszSection = _T("TabSRMM/TranslitSwitcher"); sid.cx = sid.cy = 16; sid.ptszDescription = _T("SwitchLayout and Send"); sid.pszName = "SwitchLayout and Send"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND)); hSwitchIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); sid.ptszDescription = _T("Translit and Send"); sid.pszName = "Translit and Send"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND)); hTranslitIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); sid.ptszDescription = _T("Invert Case and Send"); sid.pszName = "Invert Case and Send"; sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVERTSEND)); hInvertIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); } else if (ServiceExists(MS_BB_ADDBUTTON)) { hSwitchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND)); hTranslitIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND)); hInvertIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVERTSEND)); } if (ServiceExists(MS_BB_ADDBUTTON)) { BBButton bbd = {0}; bbd.cbSize = sizeof(BBButton); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON; bbd.pszModuleName = "SwitchLayout and Send"; bbd.ptszTooltip = TranslateT("SwitchLayout and Send"); bbd.hIcon = (HANDLE)hSwitchIcon; 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 = (HANDLE)hTranslitIcon; 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 = (HANDLE)hInvertIcon; bbd.dwButtonID = 1; bbd.dwDefPos = 50; CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd); } DestroyIcon(hSwitchIcon); DestroyIcon(hTranslitIcon); DestroyIcon(hInvertIcon); return 0; }
// Called when all the modules are loaded static int ModulesLoaded(WPARAM, LPARAM) { variables_enabled = ServiceExists(MS_VARS_FORMATSTRING); // Folders plugin support if (hDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Dictionaries"), DICTIONARIES_FOLDER)) { dictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH); FoldersGetCustomPathT(hDictionariesFolder, dictionariesFolder, MAX_PATH, _T(".")); } else dictionariesFolder = Utils_ReplaceVarsT(DICTIONARIES_FOLDER); if (hCustomDictionariesFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Custom Dictionaries"), CUSTOM_DICTIONARIES_FOLDER)) { customDictionariesFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH); FoldersGetCustomPathT(hCustomDictionariesFolder, customDictionariesFolder, MAX_PATH, _T(".")); } else customDictionariesFolder = Utils_ReplaceVarsT(CUSTOM_DICTIONARIES_FOLDER); if (hFlagsDllFolder = FoldersRegisterCustomPathT(LPGEN("Spell Checker"), LPGEN("Flags DLL"), FLAGS_DLL_FOLDER)) { flagsDllFolder = (TCHAR *)mir_alloc(sizeof(TCHAR) * MAX_PATH); FoldersGetCustomPathT(hFlagsDllFolder, flagsDllFolder, MAX_PATH, _T(".")); } else flagsDllFolder = Utils_ReplaceVarsT(FLAGS_DLL_FOLDER); InitOptions(); GetAvaibleDictionaries(languages, dictionariesFolder, customDictionariesFolder); LoadOptions(); if (opts.use_flags) { // Load flags dll TCHAR flag_file[MAX_PATH]; mir_sntprintf(flag_file, _T("%s\\flags_icons.dll"), flagsDllFolder); HMODULE hFlagsDll = LoadLibraryEx(flag_file, NULL, LOAD_LIBRARY_AS_DATAFILE); TCHAR path[MAX_PATH]; GetModuleFileName(hInst, path, MAX_PATH); SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR | SIDF_SORTED; sid.section.t = LPGENT("Spell Checker") _T("/") LPGENT("Flags"); // Get language flags for (int i = 0; i < languages.getCount(); i++) { Dictionary *p = languages[i]; sid.description.t = p->full_name; char lang[32]; mir_snprintf(lang, "spell_lang_%d", i); sid.pszName = lang; HICON hFlag = NULL, hFlagIcoLib = NULL; if (hFlagsDll != NULL) hFlag = (HICON)LoadImage(hFlagsDll, p->language, IMAGE_ICON, 16, 16, 0); if (hFlag != NULL) { sid.hDefaultIcon = hFlag; sid.defaultFile.t = NULL; sid.iDefaultIndex = 0; } else { hFlagIcoLib = IcoLib_GetIcon("spellchecker_unknown"); sid.hDefaultIcon = hFlagIcoLib; sid.defaultFile.t = NULL; sid.iDefaultIndex = 0; } // Oki, lets add to IcoLib, then p->hIcolib = IcoLib_AddIcon(&sid); if (hFlag != NULL) DestroyIcon(hFlag); else IcoLib_ReleaseIcon(hFlagIcoLib); } FreeLibrary(hFlagsDll); } for (int j = 0; j < languages.getCount(); j++) { Dictionary *dict = languages[j]; TCHAR filename[MAX_PATH]; mir_sntprintf(filename, _T("%s\\%s.ar"), customDictionariesFolder, dict->language); dict->autoReplace = new AutoReplaceMap(filename, dict); if (mir_tstrcmp(dict->language, opts.default_language) == 0) dict->load(); } HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged); HookEvent(ME_MSG_WINDOWEVENT, MsgWindowEvent); HookEvent(ME_MSG_WINDOWPOPUP, MsgWindowPopup); HookEvent(ME_MSG_ICONPRESSED, IconPressed); StatusIconData sid = { sizeof(sid) }; sid.szModule = MODULE_NAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); sid.flags = MBF_TCHAR | MBF_HIDDEN; for (int i = 0; i < languages.getCount(); i++) { sid.dwId = i; TCHAR tmp[128]; mir_sntprintf(tmp, _T("%s - %s"), TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled"); Srmm_AddIcon(&sid); } HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "Spell Checker/Toggle"; hkd.pszSection = LPGEN("Spell Checker"); hkd.pszDescription = LPGEN("Enable/disable spell checker"); hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_ALT, 'S'); hkd.lParam = HOTKEY_ACTION_TOGGLE; Hotkey_Register(&hkd); loaded = TRUE; return 0; }
/* static INT_PTR hkCloseMiranda(WPARAM wParam, LPARAM lParam) { CallService("CloseAction", 0, 0); return 0; } INT_PTR hkRestoreStatus(WPARAM wParam, LPARAM lParam) { int nStatus = db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE); CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0); return 0; } static INT_PTR hkAllOffline(WPARAM, LPARAM) { CallService(MS_CLIST_SETSTATUSMODE, ID_STATUS_OFFLINE, 0); return 0; } */ int InitClistHotKeys(void) { CreateServiceFunction("CLIST/HK/SHOWHIDE", hkHideShow); CreateServiceFunction("CLIST/HK/Opts", hkOpts); CreateServiceFunction("CLIST/HK/Read", hkRead); HOTKEYDESC shk = { sizeof(shk) }; shk.dwFlags = HKD_TCHAR; shk.ptszDescription = LPGENT("Show/Hide contact list"); shk.pszName = "ShowHide"; shk.ptszSection = _T("Main"); shk.pszService = "CLIST/HK/SHOWHIDE"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'A'); Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Read message"); shk.pszName = "ReadMessage"; shk.ptszSection = _T("Main"); shk.pszService = "CLIST/HK/Read"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'I'); Hotkey_Register(&shk); /* shk.pszDescription = "Search in site"; shk.pszName = "SearchInWeb"; shk.pszSection = "Main"; shk.pszService = "CLIST/HK/Search"; shk.DefHotKey = 846; Hotkey_Register(&shk); */ shk.ptszDescription = LPGENT("Open Options page"); shk.pszName = "ShowOptions"; shk.ptszSection = _T("Main"); shk.pszService = "CLIST/HK/Opts"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'O') | HKF_MIRANDA_LOCAL; Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Open logging options"); shk.pszName = "ShowLogOptions"; shk.ptszSection = _T("Main"); shk.pszService = "Netlib/Log/Win"; shk.DefHotKey = 0; Hotkey_Register(&shk); shk.ptszDescription = LPGENT("Open 'Find user' dialog"); shk.pszName = "FindUsers"; shk.ptszSection = _T("Main"); shk.pszService = "FindAdd/FindAddCommand"; shk.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'F') | HKF_MIRANDA_LOCAL; Hotkey_Register(&shk); /* shk.pszDescription = "Close Miranda"; shk.pszName = "CloseMiranda"; shk.pszSection = "Main"; shk.pszService = "CLIST/HK/CloseMiranda"; shk.DefHotKey = 0; Hotkey_Register(&shk); shk.pszDescription = "Restore last status"; shk.pszName = "RestoreLastStatus"; shk.pszSection = "Status"; shk.pszService = "CLIST/HK/RestoreStatus"; shk.DefHotKey = 0; Hotkey_Register(&shk); shk.pszDescription = "Set All Offline"; shk.pszName = "AllOffline"; shk.pszSection = "Status"; shk.pszService = "CLIST/HK/AllOffline"; shk.DefHotKey = 0; Hotkey_Register(&shk); */ return 0; }
extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) { pluginLink = link; mir_getMMI(&mmi); mir_getLI(&li); mir_getMD5I(&md5i); mir_getUTFI(&utfi); #else extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); InitServices(); #endif db_set_b(NULL, MODNAME, "NeedRestart", 0); DWORD dwLen = GetTempPath( SIZEOF(tszTempPath), tszTempPath); if (tszTempPath[dwLen-1] == '\\') tszTempPath[dwLen-1] = 0; LoadOptions(); InitPopupList(); InitNetlib(); InitIcoLib(); // Add cheking update menu item InitCheck(); CLISTMENUITEM mi = { sizeof(mi) }; mi.position = 400010000; mi.icolibItem = Skin_GetIconHandle("check_update"); mi.pszName = LPGEN("Check for updates"); mi.pszService = MODNAME"/CheckUpdates"; Menu_AddMainMenuItem(&mi); #if MIRANDA_VER >= 0x0A00 InitListNew(); mi.position++; mi.icolibItem = Skin_GetIconHandle("plg_list"); mi.pszName = LPGEN("Available components list"); mi.pszService = MODNAME"/ShowList"; Menu_AddMainMenuItem(&mi); InitOptions(); #endif // Add hotkey HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "Check for updates"; hkd.pszDescription = "Check for updates"; hkd.pszSection = "Plugin Updater"; hkd.pszService = MODNAME"/CheckUpdates"; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F10) | HKF_MIRANDA_LOCAL; hkd.lParam = FALSE; Hotkey_Register(&hkd); InitEvents(); //add sounds SkinAddNewSoundEx("updatecompleted",LPGEN("Plugin Updater"),LPGEN("Update completed")); SkinAddNewSoundEx("updatefailed",LPGEN("Plugin Updater"),LPGEN("Update failed")); return 0; }
c) send later job management. Periodically process the queue of open deferred send jobs. */ #include "commonheaders.h" #pragma hdrstop extern HICON hIcons[]; extern INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam); extern INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam); static UINT WM_TASKBARCREATED; static HANDLE hSvcHotkeyProcessor = 0; static HOTKEYDESC _hotkeydescs[] = { { 0, "tabsrmm_mostrecent", "Most recent unread session", TABSRMM_HK_SECTION_IM, MS_TABMSG_HOTKEYPROCESS, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'R'), TABSRMM_HK_LASTUNREAD }, { 0, "tabsrmm_paste_and_send", "Paste and send", TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'D'), TABSRMM_HK_PASTEANDSEND }, { 0, "tabsrmm_uprefs", "Contact's messaging prefs", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'C'), TABSRMM_HK_SETUSERPREFS }, { 0, "tabsrmm_copts", "Container options", TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'O'), TABSRMM_HK_CONTAINEROPTIONS }, { 0, "tabsrmm_nudge", "Send nudge", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'N'), TABSRMM_HK_NUDGE }, { 0, "tabsrmm_sendfile", "Send a file", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'F'), TABSRMM_HK_SENDFILE }, { 0, "tabsrmm_quote", "Quote message", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'Q'), TABSRMM_HK_QUOTEMSG }, { 0, "tabsrmm_sendlater", "Toggle send later", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, 'S'), TABSRMM_HK_TOGGLESENDLATER }, { 0, "tabsrmm_send", "Send message", TABSRMM_HK_SECTION_GENERIC, 0, 0, TABSRMM_HK_SEND }, { 0, "tabsrmm_emot", "Smiley selector", TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT, 'E'), TABSRMM_HK_EMOTICONS }, { 0, "tabsrmm_hist", "Show message history", TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT, 'H'), TABSRMM_HK_HISTORY }, { 0, "tabsrmm_umenu", "Show user menu", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'D'), TABSRMM_HK_USERMENU }, { 0, "tabsrmm_udet", "Show user details", TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'U'), TABSRMM_HK_USERDETAILS }, { 0, "tabsrmm_tbar", "Toggle tool bar", TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT|HOTKEYF_SHIFT, 'T'), TABSRMM_HK_TOGGLETOOLBAR }, { 0, "tabsrmm_ipanel", "Toggle info panel", TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT|HOTKEYF_CONTROL, 'I'), TABSRMM_HK_TOGGLEINFOPANEL },
static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) { CreateServiceFunction(MS_CONSOLE_SHOW_HIDE, ShowHideConsole); FontIDT fid = {0}; fid.cbSize = sizeof(fid); _tcscpy(fid.group,_T("Console")); _tcscpy(fid.name,TranslateT("Text")); strcpy(fid.dbSettingsGroup,"Console"); strcpy(fid.prefix,"ConsoleFont"); _tcscpy(fid.backgroundGroup,_T("Console")); _tcscpy(fid.backgroundName,_T("Background")); fid.flags = FIDF_DEFAULTVALID; fid.deffontsettings.charset = DEFAULT_CHARSET; fid.deffontsettings.colour = RGB(0, 0, 0); fid.deffontsettings.size = 10; fid.deffontsettings.style = 0; _tcsncpy(fid.deffontsettings.szFace, _T("Courier"), LF_FACESIZE); FontRegisterT(&fid); HookEvent(ME_FONT_RELOAD,OnFontChange); ColourIDT cid = {0}; cid.cbSize=sizeof(cid); _tcscpy(cid.group,_T("Console")); _tcscpy(cid.name,_T("Background")); strcpy(cid.dbSettingsGroup,"Console"); strcpy(cid.setting,"BgColor"); cid.defcolour = RGB(255,255,255); ColourRegisterT(&cid); HookEvent(ME_COLOUR_RELOAD, OnColourChange); HOTKEYDESC hkd = {0}; hkd.cbSize = sizeof(hkd); hkd.pszName = "Console_Show_Hide"; hkd.pszDescription = LPGEN("Show/Hide Console"); hkd.pszSection = "Main"; hkd.pszService = MS_CONSOLE_SHOW_HIDE; hkd.DefHotKey = HOTKEYCODE(HOTKEYF_EXT, 'C'); Hotkey_Register(&hkd); if (hwndConsole && IsWindow(hwndConsole)) { HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIF_TCHAR; mi.hIcon = hIcons[0]; mi.ptszPopupName = LPGENT("&Help"); mi.popupPosition = 2000090000; mi.position = 1000000000; mi.ptszName = (IsWindowVisible(hwndConsole)) ? LPGENT("Hide Console") : LPGENT("Show Console"); mi.pszService = MS_CONSOLE_SHOW_HIDE; hMenu = Menu_AddMainMenuItem(&mi); OnFontChange(0,0); OnColourChange(0,0); if (db_get_b(NULL,"Console","ShowAtStart",0) || db_get_b(NULL,"Console","Show",1)) ShowConsole(1); else ShowConsole(0); } return 0; }