private void LoadSettingsMediaInfoControls() { if (string.IsNullOrEmpty(App.Settings.CustomMediaInfoDllDir)) { App.Settings.CustomMediaInfoDllDir = Application.StartupPath; } Kernel32Helper.SetDllDirectory(App.Settings.CustomMediaInfoDllDir); }
public static IAppInfo CreateForProcess(int processId, bool trackProcess = false) { if (processId == 0) { return(new Internal.SystemSoundsAppInfo()); } if (Kernel32Helper.IsPackagedProcess(processId)) { return(new Internal.ModernAppInfo(processId, trackProcess)); } else { return(new Internal.DesktopAppInfo(processId, trackProcess)); } }
/// <summary> /// Create a new instance of the <see cref="KeyboardHook"/> and initialize ith internal structures. /// </summary> public KeyboardHook() { Filters = new List <IKeyboardHookFilter>(); m_HookQueue = new BlockingCollection <KeyData>(); m_WorkerThread = new Thread(Worker); m_WorkerThread.Start(); using (Process curProc = Process.GetCurrentProcess()) { using (ProcessModule curModule = curProc.MainModule) { m_LowLevelKeyboardCallback = new User32Helper.LowLevelKeyboardProc(HookCallBack); m_HookID = User32Helper.SetWindowsHookEx(User32Helper.WH.KEYBOARD_LL, m_LowLevelKeyboardCallback, Kernel32Helper.GetModuleHandle(curModule.ModuleName), 0); } } }