static int ModulesLoaded(WPARAM wParam, LPARAM lParam) { TCHAR eventPrefix[MAX_PATH+1], eventName[MAX_PATH+1]; createProtocolList(); LoadSettings(); // Create some synchronisation objects createEventPrefix(eventPrefix, MAX_PATH - 11); mir_sntprintf(eventName, SIZEOF(eventName), _T("%s/FlashEvent"), eventPrefix); hFlashEvent = CreateEvent(NULL, FALSE, FALSE, eventName); mir_sntprintf(eventName, SIZEOF(eventName), _T("%s/ExitEvent"), eventPrefix); hExitEvent = CreateEvent(NULL, FALSE, FALSE, eventName); hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)FlashThreadFunction, NULL, 0, &IDThread); hMsgEventHook = HookEvent(ME_DB_EVENT_ADDED, PluginMessageEventHook); hOptionsInitialize = HookEvent(ME_OPT_INITIALISE, InitializeOptions); hEnableService = CreateServiceFunction(MS_KBDNOTIFY_ENABLE, EnableService); hDisableService = CreateServiceFunction(MS_KBDNOTIFY_DISABLE, DisableService); hStartBlinkService = CreateServiceFunction(MS_KBDNOTIFY_STARTBLINK, StartBlinkService); hEventsOpenedService = CreateServiceFunction(MS_KBDNOTIFY_EVENTSOPENED, EventsWereOpenedService); hFlashingEventService = CreateServiceFunction(MS_KBDNOTIFY_FLASHINGACTIVE, IsFlashingActiveService); hNormalizeSequenceService = CreateServiceFunction(MS_KBDNOTIFY_NORMALSEQUENCE, NormalizeSequenceService); return 0; }
static int ModulesLoaded(WPARAM, LPARAM) { TCHAR eventPrefix[MAX_PATH + 1], eventName[MAX_PATH + 1]; createProtocolList(); LoadSettings(); // Create some synchronisation objects createEventPrefix(eventPrefix, MAX_PATH - 11); mir_sntprintf(eventName, _T("%s/FlashEvent"), eventPrefix); hFlashEvent = CreateEvent(NULL, FALSE, FALSE, eventName); mir_sntprintf(eventName, _T("%s/ExitEvent"), eventPrefix); hExitEvent = CreateEvent(NULL, FALSE, FALSE, eventName); hThread = mir_forkthread(FlashThreadFunction, 0); HookEvent(ME_MC_ENABLED, OnMetaChanged); HookEvent(ME_DB_EVENT_ADDED, PluginMessageEventHook); HookEvent(ME_OPT_INITIALISE, InitializeOptions); CreateServiceFunction(MS_KBDNOTIFY_ENABLE, EnableService); CreateServiceFunction(MS_KBDNOTIFY_DISABLE, DisableService); CreateServiceFunction(MS_KBDNOTIFY_STARTBLINK, StartBlinkService); CreateServiceFunction(MS_KBDNOTIFY_EVENTSOPENED, EventsWereOpenedService); CreateServiceFunction(MS_KBDNOTIFY_FLASHINGACTIVE, IsFlashingActiveService); CreateServiceFunction(MS_KBDNOTIFY_NORMALSEQUENCE, NormalizeSequenceService); return 0; }