SetViewerInFocus
- Last UpdatedOct 29, 2026
- 2 minute read
SetViewerInFocus moves the Viewer program window in front of all other open windows.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
SetViewerInFocus |
Module Activity |
Synchronous |
No |
Supported |
Not supported |
Not supported |
Supported |
Not supported |
Syntax
SetViewerInFocus()
This function has no parameters.
Return value
This function returns no value.
Notes
For the purposes of this function, "Viewer program" is a generic term that includes:
-
The local Viewer that is part of the project runtime for Windows
-
The standalone Secure Viewer program for Windows
-
The Web Thin Client add-on (ISSymbol) for Internet Explorer
It does not include any version of Mobile Access, which uses a different technology to display project screens in web browsers.
Security features in the Windows operating system prevent program windows from moving themselves in front of other open windows without user input. As such, when this function is executed, the Viewer program will request the user's attention by blinking its icon in the Windows taskbar. (Some anti-virus software may also flag this as suspicious behavior.) It is only when the user selects the Viewer program that the program window will move to the front.
To work around this limitation, you must call this function at least once in the project VBScript Startup Script. Allow twenty seconds more for your project to finish starting up, and then after that, any additional calls of this function should work as expected.
If you are not satisfied with the runtime behavior of this function, you can use the AppActivate function instead to achieve similar results. Also, you can use the SetViewerPos function to change the size and position of the Viewer program window, if necessary.