我使用此代码打开网站
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
ShellExecute Me.hwnd, "open", webURL, vbNullString, webBrowser, vbNormal
现在我想在时间限制后自动关闭网站。
或Web浏览器中的Addonn,会在一段时间后(例如30秒)自动关闭当前标签
任何想法或建议?
答案 0 :(得分:2)
使用ShellExecute
(here is a sample)更改ShellExecuteEx
,SHELLEXECUTEINFO.hProcess
会返回TerminateProcess
中已启动流程的句柄。然后,当达到超时时,使用{{1}} api call(another sample)