コード例 #1
0
        /// <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)
                    });
                }
            };
        }
コード例 #2
0
        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)
                });
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public Monitor(LightProcessMonitor lightProcessMonitor) : base(lightProcessMonitor)
 {
 }