The following function runs an application and optionally minimizes it. If the optional isMinimize parameter is not specified by the caller, then the application is not minimized.
Sub Test(AppName As String,Optional isMinimize As Variant)
????app = Shell(AppName)
????If Not IsMissing(isMinimize) Then
????????AppMinimize app
????Else
????????AppMaximize app
????End If
End Sub
Sub Main
????Test "notepad.exe"????????????????????'Maximize this application
????Test "notepad.exe",True??????????'Minimize this application
End Sub
|