AppActivate is a built-in scripting function that activates (i.e., brings to the front) another application window that is already open.
Function | Group | Execution | Windows | Embedded | Thin Client |
---|---|---|---|---|---|
AppActivate | Module Activity | Asynchronous | Supported | Supported | Supported |
Value | Command | Description |
---|---|---|
0 | SW_HIDE | Hides the currently active window and then activates the specified window. |
1 | SW_SHOWNORMAL | Activates
and displays the specified window. If the window is minimized or
maximized, then it is restored to its original size and position.
You should use this command when displaying a window for the first time. |
2 | SW_SHOWMINIMIZED | Activates the specified window and then minimizes it. |
3 | SW_SHOWMAXIMIZED | Activates the specified window and then maximizes it. |
4 | SW_SHOWNOACTIVATE | Displays the specified window, but does not activate it. If the window is minimized or maximized, then it is restored to its original size and position. |
5 | SW_SHOW | Activates and displays the specified window in its current size and position. This is similar to SW_SHOWNORMAL except that if the window is minimized or maximized, then it remains in that state. |
6 | SW_MINIMIZE | Minimizes the specified window and then activates the next open window. |
7 | SW_SHOWMINNOACTIVATE | Displays the specified window as a minimized window, but does not activate it. |
8 | SW_SHOWNA | Displays the specified window in its current size and position, but does not activate it. This is similar to SW_SHOWNOACTIVATE except that if the window is minimized or maximized, then it remains in that state. |
9 | SW_RESTORE | Activates
and displays the specified window. If the window is minimized or
maximized, then it is restored to its original size and position.
You should use this command when restoring a minimized window. |
This is an optional parameter. If no value is specified, then the default command is SW_RESTORE.
This is an optional parameter. If no value is specified, then the default timeout is five seconds (or 5000 milliseconds).
Value | Description |
---|---|
0 | ERROR: The specified application window was not activated or otherwise did not respond within the timeout period. |
1 | SUCCESS: The specified application window was successfully activated. |
AppActivate is similar to the function ShowWindow in the Microsoft Windows API, and it allows many of the same options. For more information, please refer to the Windows API documentation.
AppActivate( "test.doc — Microsoft Word", 5 )