本示例将判断当前应用程序是否为活动程序。

If Application.Active Then
    MsgBox "this is an active windows"
Else
    MsgBox "this is not an active windows"
End If