/// <summary> /// روی ویندوز 7 میتوان هر پنجره جدید اکسپلورر را در یک پروسه جدید اجرا کرد /// </summary> private static void processMonitorStart() { LightProcessMonitor.Start(names: _processesList); LightProcessMonitor.OnProcessCallback = explorers => { if (explorers == null || !explorers.Any()) { AppMessenger.Messenger.NotifyColleagues("AddLog", new Log { Text = "explorer در حال اجرا نيست." }); return; } try { injectHooks(explorers); } catch (Exception ex) { ExceptionLogger.LogExceptionToFile(ex); AppMessenger.Messenger.NotifyColleagues("AddLog", new Log { Text = string.Format("خطا:{0}", ex) }); } }; }
public static void UnloadChannel() { if (_channel == null) { return; } try { // cleanup library... _channel.StopListening(null); _channel = null; LightProcessMonitor.Stop(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); } catch (Exception ex) { ExceptionLogger.LogExceptionToFile(ex); AppMessenger.Messenger.NotifyColleagues("AddLog", new Log { Text = string.Format("خطا:{0}", ex) }); } }
private static IpcServerChannel runGetTimeDateFormatHook() { var explorers = LightProcessMonitor.FindProcesses(names: _processesList); if (explorers == null || !explorers.Any()) { AppMessenger.Messenger.NotifyColleagues("AddLog", new Log { Text = "explorer در حال اجرا نيست." }); return(null); } var channel = RemoteHooking.IpcCreateServer <MessagesReceiverInterface>(ref _channelName, WellKnownObjectMode.SingleCall); injectHooks(explorers); return(channel); }
public Monitor(LightProcessMonitor lightProcessMonitor) : base(lightProcessMonitor) { }