不通过Process.Get....来,只要有新程序打开就得到通知有没有WINAPI调用?

解决方案 »

  1.   

    hock c#   baidu   google  都能找到例子  
      

  2.   

    Shell Hook or API Hook
      

  3.   

    Win32_ProcessStartTrace WMI事件(异步通知,有延迟)。public partial class Form1 : Form
    {
        ManagementEventWatcher processStartWatcher = new ManagementEventWatcher(new WqlEventQuery("Win32_ProcessStartTrace"));
        public Form1()
        {
            InitializeComponent();
            processStartWatcher.EventArrived += delegate(object sender, EventArrivedEventArgs e)
            {
                string processName = e.NewEvent.Properties["ProcessName"].Value as string;
                this.Invoke( (EventHandler)delegate{ this.Text = processName;});
            };
            processStartWatcher.Start();
            this.FormClosing += delegate { processStartWatcher.Stop(); };
        }
    }
      

  4.   

    Win32_ProcessStartTrace WMI事件