Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VB.NET阻止AppCursor即使在多线程时也显示_Vb.net_Multithreading - Fatal编程技术网

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

VB.NET阻止AppCursor即使在多线程时也显示,vb.net,multithreading,Vb.net,Multithreading,我正在尝试编程一个windows服务,用于监视进程是否正在运行 我使用Threading.Timer每秒检查一次进程。然而,如果我这样做,每次检查进程时,我都会得到一个恼人的AppStarting光标 For Each p As Process In Process.GetProcesses If p.MainWindowTitle = String.Empty = False Then If p.ProcessName = "MyApp2Moni

我正在尝试编程一个windows服务,用于监视进程是否正在运行

我使用Threading.Timer每秒检查一次进程。然而,如果我这样做,每次检查进程时,我都会得到一个恼人的AppStarting光标

    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
我还尝试了backgrounder和其他多线程变体。一切都会重复,但恼人的光标每秒都会出现

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


谢谢

嗯,代码和问题都没有任何意义。不要在服务中显示消息框。只是一个可读性想法:与其这样做,不如这样写:如果p.MainWindowTitle=String.Empty=False,那么为什么不写这个:如果p.MainWindowTitle String.Empty,那么