即使在多线程时,VB.NET也会阻止AppCursor显示

时间:2012-05-28 10:34:59

标签: vb.net multithreading

我正在尝试编写一个监视进程是否正在运行的Windows服务。

我使用Threading.Timer每秒检查进程。但是,如果我这样做,每次检查进程时都会收到恼人的AppStarting Cursor。

    For Each p As Process In Process.GetProcesses
        If p.MainWindowTitle = String.Empty = False Then
            If p.ProcessName = "MyApp2Monitor" Then
                WriteToFile("C:\log.txt","app started")
                Exit For
            End If
        End If
    Next

我还尝试了背景和多线程的其他变体。一切都保持代表性,但烦人的光标每秒都出现。

如何摆脱AppStarting cusor?我是否可以禁止进程列表例程触发可能触发AppStarting游标的繁忙系统事件?

由于

0 个答案:

没有答案