Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
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
Private Sub Command1_Click()
Dim ie As Long
ie = ShellExecute(Me.hwnd, "open", "C:\Program Files\Internet Explorer\IEXPLORE.EXE", "www.csdn.net", vbNullString, 1)
Dim start As Double
start = Timer
Do
DoEvents
Loop While Timer - start < 1
keybd_event vbKeyF11, 0, 0, 0
End Sub
用个api函数
Public 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
接可以,不管ie装在那里.
我现在基本上都是用这里来完成的