private void BGthread_DoWork(object sender, DoWorkEventArgs e) { for (; ;) { if (memLib.OpenProcess(Offsets.ProcessName) == true) { ProcessStatus = true; Thread.Sleep(1000); } else { Thread.Sleep(1000); return; } BGthread.ReportProgress(1); } }
private void Form1_Shown(object sender, EventArgs e) { BGthread.RunWorkerAsync(); }
private void BGthread_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { BGthread.RunWorkerAsync(); }