AppGetState (function)

Syntax

AppGetState[([name$])]

Description

Returns an Integer specifying the state of the top-level window.

Comments

The AppGetState function returns any of the following values:

 

If the window is

then AppGetState returns

 

Maximized

ebMaximized

 

Minimized

ebMinimized

 

Restored

ebRestored

 

The name$ parameter is a String containing the name of the desired application. If it is omitted, then the AppGetState function returns the name of the active application.

Examples

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

AppMaximize (statement); AppMinimize (statement); AppRestore (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.

More information

A