Dim proc As new process
proc.file ="calc.exe"
proc.start()
上段代码为打开计算器,如何禁止重复打开?
思路1:如果已打开,禁止重复打开,最好如此
思路2:如果已打开,先关闭后再打开
上端代码是打开了计算器进程
使用下面代码,提示错误
Dim proc As new process
proc.file ="calc.exe"
proc.Close()
使用别的代码,依然不成功,点击按钮时继续打开计算器
If FileIsOpened("calc.exe")= True Then
Return
Else
Dim proc As new process
proc.file ="calc.exe"
proc.start()
End If
直接到计算器根目录,依然不成
If FileIsOpened("C:\WINDOWS\system32\calc.exe")= True Then
Return
Else
Dim proc As new process
proc.file ="calc.exe"
proc.start()
End If
[此贴子已经被作者于2014-2-16 16:54:49编辑过]