VB如何调用IE浏览器??

VB如何调用IE浏览器??,第1张

'新建两个按钮,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(">

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12788641.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-28
下一篇 2023-05-28

发表评论

登录后才能评论

评论列表(0条)

保存