'新建两个
按钮,command1、command2,1为关闭,2为打开。'使用到的APIPrivate Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As LongPrivate Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongPrivate Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As LongConst PROCESS_TERMINATE = 1'Private Declare Function ShellExecute Lib "shell32dll" 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 LongConst SW_SHOWNORMAL = 1Const SW_MINIMIZE = 6Dim pid&, hProcess&Private Sub Command1_Click() hProcess = OpenProcess(PROCESS_TERMINATE, False, pid) TerminateProcess hProcess, 1 CloseHandle hProcessEnd SubPrivate Sub Command2_Click() pid = Shell("C:\Program Files\Internet Explorer\IEXPLOREEXE >在
窗体上放一个WebBrowser控件(浏览网页用的)和一个TextBox(输入地址),一个按钮(
转到)代码:
Private Sub Form_Load()
WebBrowser1Navigate(">
评论列表(0条)