Option Explicit
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Shell "Calc.exe", vbHide
End Sub
Private Sub Command2_Click()
Dim calcHwnd As Long
calcHwnd = FindWindow(vbNullString, "计算器")
If calcHwnd <> 0 Then
ShowWindow calcHwnd, SW_HIDE
End If
End Sub