Advertisement
botvn

getprocess

Jun 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.             timer1.Start();
  20.         }
  21.  
  22.         private void timer1_Tick(object sender, EventArgs e)
  23.         {
  24.             listView1.Items.Clear();
  25.             Process[] processlist = Process.GetProcesses();
  26.             foreach(Process process in processlist){
  27.                 if(process.MainWindowTitle.Length>0)
  28.                 listView1.Items.Add(process.ProcessName);
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement