定义: Public Const wm_close = &H10 Public Const wm_quit = &H12 Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 语句: Handle = FindWindow("ieframe", vbNullString) PostMessage handle,wm_close, 0, 0
Public Const wm_close = &H10
Public Const wm_quit = &H12
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
语句:
Handle = FindWindow("ieframe", vbNullString)
PostMessage handle,wm_close, 0, 0
把windsandy(风中飘絮) 的代码修改倒数第二句为:
handle=FindWindow(vbNullString, "窗体标题")
其它不变。给我加分我很高兴,如果不加,我也不会怪你,我天生好心,助人乃快乐之本。