Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_CLOSE = &H10
Private Sub Timer1_Timer()
CLOSEFROM
End Sub
Sub CLOSEFROM()
Dim H As Long, rtn As Long
H = FindWindow(vbNullString, "关闭 Windows")
rtn = SendMessage(H, WM_CLOSE, 0, 0)
If H <> 0 Then
MsgBox "成功关闭<关闭 Windows>!", vbInformation, "提示" ' 此处添加你的代码!