Private 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 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Const WM_CLOSE = &H10 Private Const WM_QUIT = &H12Dim handle as longhandle=FindWindow("","Window title which you want to close")PostMessage handle,WM_CLOSE,0,0 '或 PostMessage handle,WM_QUIT,0,0
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const WM_CLOSE = &H10
Private Const WM_QUIT = &H12Dim handle as longhandle=FindWindow("","Window title which you want to close")PostMessage handle,WM_CLOSE,0,0
'或
PostMessage handle,WM_QUIT,0,0