AppSetState (statement)

Syntax AppSetState newstate [,name$]
Description Maximizes, minimizes, or restores the named application, depending on the value of newstate.
Comments The AppSetState statement takes the following parameters:
Parameter Description
Newstate Integer specifying the new state of the window. It can be any of the following values.
Value Description
ebMaximized The named application is maximized.
ebMinimized The named application is minimized.
ebRestored The named application is restored.
Name$ String containing the name of the application to change. If this parameter is omitted, then the active application is used.
Example This example saves the state of Program Manager, changes it, then restores it to its original setting.
Sub Main()
  If AppFind$("Program Manager") = "" Then
    MsgBox "Can't find Program Manager."
    Exit Sub
  End If
  AppActivate "Program Manager"     'Activate Program Manager.
  state = AppGetState             'Save its state.
  AppMinimize                  'Minimize it.
  MsgBox "Program Manager is now minimized. Select OK to restore it."
  AppActivate "Program Manager"
  AppSetState state               'Restore it.
End Sub
See Also AppGetState (function);  AppRestore (statement); AppMaximize (statement); AppMinimize (statement)
Notes The name$ parameter is the exact string appearing in the title bar of the named application's main window. If no application is found whose title exactly matches name$, then a second search is performed for applications whose title string begins with name$. If more than one application is found that matches name$, then the first application encountered is used.