1 /* 2 * PROJECT: ReactOS CTF Monitor 3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later) 4 * PURPOSE: Registry watcher 5 * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> 6 */ 7 8 #pragma once 9 10 struct WATCHENTRY 11 { 12 HKEY hRootKey; 13 LPCTSTR pszSubKey; 14 HKEY hKey; 15 }; 16 17 #define WATCHENTRY_MAX 12 18 19 struct CRegWatcher 20 { 21 static HANDLE s_ahWatchEvents[WATCHENTRY_MAX]; 22 static WATCHENTRY s_WatchEntries[WATCHENTRY_MAX]; 23 static UINT s_nSysColorTimerId, s_nKbdToggleTimerId, s_nRegImxTimerId; 24 25 static BOOL Init(); 26 static VOID Uninit(); 27 static BOOL InitEvent(_In_ SIZE_T iEvent, _In_ BOOL bResetEvent); 28 static VOID UpdateSpTip(); 29 static VOID KillInternat(); 30 static VOID StartSysColorChangeTimer(); 31 static VOID OnEvent(_In_ SIZE_T iEvent); 32 33 protected: 34 static BOOL CALLBACK 35 EnumWndProc(_In_ HWND hWnd, _In_ LPARAM lParam); 36 37 static VOID CALLBACK 38 SysColorTimerProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ UINT_PTR idEvent, _In_ DWORD dwTime); 39 40 static VOID CALLBACK 41 KbdToggleTimerProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ UINT_PTR idEvent, _In_ DWORD dwTime); 42 43 static VOID CALLBACK 44 RegImxTimerProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ UINT_PTR idEvent, _In_ DWORD dwTime); 45 }; 46