// Tabsrmm toolbar support static int TabsrmmButtonPressed(WPARAM, LPARAM lParam) { CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam; if (!strcmp(cbcd->pszModule, MOD_NAME)) BossKeyHideMiranda(0, 0); return 0; }
VOID CALLBACK IdleTimer(HWND, UINT, UINT_PTR idEvent, DWORD) { if (hTimer == idEvent && !g_bWindowHidden && ((g_wMaskAdv & (OPT_HIDEIFWINIDLE | OPT_HIDEIFMIRIDLE) && IsUserIdle()) || (g_wMaskAdv & OPT_HIDEIFSCRSVR) && IsScreenSaverRunning())) BossKeyHideMiranda(0, 0); }
int MirandaLoaded(WPARAM,LPARAM) { g_wMask = db_get_w(NULL,MOD_NAME,"optsmask",DEFAULTSETTING); RegisterCoreHotKeys(); g_hWinHook = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_SHOW, NULL, WinEventProc, GetCurrentProcessId(), 0, 0); HookEvent(ME_TTB_MODULELOADED, TopToolbarInit); HookEvent(ME_OPT_INITIALISE, OptsDlgInit); HookEvent(ME_MSG_WINDOWEVENT, MsgWinOpening); HookEvent(ME_PROTO_ACCLISTCHANGED, EnumProtos); HookEvent(ME_MSG_TOOLBARLOADED, TabsrmmButtonsInit); HookEvent(ME_MSG_BUTTONPRESSED, TabsrmmButtonPressed); GetWindowThreadProcessId(pcli->hwndContactList, &g_dwMirandaPID); WNDCLASS winclass = {0}; winclass.lpfnWndProc = ListenWndProc; winclass.hInstance = g_hInstance; winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); winclass.lpszClassName = BOSSKEY_LISTEN_INFO; if (RegisterClass(&winclass)) { g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO,BOSSKEY_LISTEN_INFO,WS_POPUP,0,0,5,5,pcli->hwndContactList,NULL,g_hInstance,NULL); WTSRegisterSessionNotification(g_hListenWindow, 0); } if (IsWinVerVistaPlus()) { hDwmApi = LoadLibrary(_T("dwmapi.dll")); if (hDwmApi) dwmIsCompositionEnabled = (PFNDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled"); } if (g_wMaskAdv & OPT_MENUITEM) BossKeyMenuItemInit(); // Register token for variables plugin if (ServiceExists(MS_VARS_REGISTERTOKEN)) { TOKENREGISTER tr = {0}; tr.cbSize = sizeof(TOKENREGISTER); tr.memType = TR_MEM_OWNER; tr.flags = TRF_FIELD | TRF_TCHAR | TRF_PARSEFUNC; tr.tszTokenString = _T("bosskeyname"); tr.parseFunctionT = VariablesBossKey; tr.szHelpText = LPGEN("BossKey")"\t"LPGEN("get the BossKey name"); CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr); } EnumProtos(0, 0); InitIdleTimer(); if (g_bOldSetting && !(g_wMaskAdv & OPT_RESTORE)) // Restore settings if Miranda was crushed or killed in hidden mode and "Restore hiding on startup after failure" option is disabled RestoreOldSettings(); if ((g_wMaskAdv & OPT_HIDEONSTART) || (g_wMaskAdv & OPT_RESTORE && g_bOldSetting)) BossKeyHideMiranda(0, 0); return 0; }