2014-01-09 115 views
0

我使用此代碼,打開網頁,如何關閉打開一個網站使用的ShellExecute VB6

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 

現在我想以後的時間限制自動關閉該網站。

或者Addonn在Web瀏覽器一段時間後,它會自動關閉當前標籤(例如:30秒)

任何想法或建議?

回答

2

更改ShellExecuteShellExecuteExhere is a sample)它會返回您在SHELLEXECUTEINFO.hProcess中啓動的進程的句柄。然後,當達到超時時,使用TerminateProcess api調用(another sample