Beispiel #1
0
        private void GetAllProcesses()
        {
            var activeProcceses        = Process.GetProcesses();
            int activeApplicationCount = 0;

            foreach (Process process in activeProcceses)
            {
                if (process.MainWindowHandle != IntPtr.Zero && process.Id != Process.GetCurrentProcess().Id)
                {
                    try
                    {
                        string path = GetPathFromProcessId(process);
                        if (path != string.Empty && File.Exists(path))
                        {
                            ProcessExplorerEntry processEntry = new ProcessExplorerEntry(path, Icon.ExtractAssociatedIcon(path), process);
                            backgroundWorker.ReportProgress(++activeApplicationCount, processEntry);
                        }
                    }
                    catch (Exception ex)
                    {
                        VibranceGUI.Log(ex);
                    }
                }
            }
        }
Beispiel #2
0
 public void RemoveWinEventHook()
 {
     try
     {
         bool result = UnhookWinEvent(_winEventHookHandle);
         if (!result)
         {
             VibranceGUI.Log(new Exception("UnhookWinEvent(winEventHookHandle) failed. winEventHookHandle = " + _winEventHookHandle));
         }
     }
     catch (Exception ex)
     {
         VibranceGUI.Log(new Exception("UnhookWinEvent(winEventHookHandle) failed."));
     }
     finally
     {
     }
 }