编一个能够在指定时间之后自动关闭指定应用程序的程序
答案:2 悬赏:40
解决时间 2022-01-01 03:33
- 提问者网友:唤魂
- 2021-12-31 03:13
比如说我想在40分钟后关闭QQ这个程序,应该如何实现? VB VC皆可
最佳答案
- 二级知识专家网友:猖狂的痴情人
- 2021-12-31 04:30
dim m as integer On Error GoTo Err Dim WMI Dim Obj Dim Objs CheckApplicationIsRun = False Set WMI = GetObject("WinMgmts:") Set Objs = WMI.InstancesOf("Win32_Process") For Each Obj In Objs If InStr(UCase(szExeFileName), UCase(Obj.Description)) <> 0 Then CheckApplicationIsRun = True If Not Objs Is Nothing Then Set Objs = Nothing If Not WMI Is Nothing Then Set WMI = Nothing Exit Function End If Next If Not Objs Is Nothing Then Set Objs = Nothing If Not WMI Is Nothing Then Set WMI = Nothing Exit Function Err: If Not Objs Is Nothing Then Set Objs = Nothing If Not WMI Is Nothing Then Set WMI = Nothing End Function Private Sub Timer1_Timer() '//timer1的interval属性设置为:1000 m=m+1 if m=3600 then If CheckApplicationIsRun("QQ.exe") = True Then '//检查QQ进程(QQ.exe) Shell "taskkill /im QQ.exe /f", vbHideElse End If end if End Sub
全部回答
- 1楼网友:邪性洒脱
- 2021-12-31 05:53
我暂时保留我的看法!
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯