sWhat | (String) Obtained information identifier. The basic option specifies what to return.
"screen.width" - Returns the width of the display (in pixels).
The sParams parameter is not used. See Example1. "screen.height" - Returns the height of the display (in pixels).
The sParams parameter is not used. See Example1. "screen.clientarea.width" - Returns the width of the client area of the display (Windows OS toolbar not included) (in pixels).
The sParams parameter is not used. "screen.clientarea.height" - Returns the height of the client area of the display (Windows OS toolbar not included) (in pixels).
The sParams parameter is not used. "screen.allmonitors" - Returns position and total size of circumscribe rectangle around all displays (in pixels) in the form of the PmMap object. PmMap contains properties x, y, dx and dy defining the position and size.
The sParams parameter is not used. "app.zoom" - Returns a value of magnification/minification factor of the whole application as a result of adapting to the resolution of the display compared to the original application.
See the "Application appearance zoom" configurator. The sParams parameter is not used. "screensaver.active" - Returns the flag indicating whether or not is the screensaver active (not the dispay sleep mode).
The sParams parameter is not used. "memory.free" - Returns a value of free system memory in kB (with the precision of 4 kB).
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "memory.usage" - Returns the size of used system memory in kB (with the precision of 4 kB).
The computer memory usage can also be detected in the "/System/Memory" item of the INFO system. See also How to monitor the running PROMOTIC application. It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "cpu.usage" - Returns a value of average CPU load in percentage. The value represents the average load of all CPU cores since the last calling this method.
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "objects.kernel.usage" - Returns the number of handles (Handle, KERNEL objects) of the process.
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "objects.gdi.usage" - Returns the number of GDI objects of the process.
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "objects.gdi.usage.peak" - Returns the maximum reached value of the number of GDI objects of the process.
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "objects.user.usage" - Returns the number of USER objects (User interface objects) of the process.
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "objects.user.usage.peak" - Returns the maximum reached value of the USER objects number (User interface objects) of the process.
It is often handy to monitor this value when debugging the application. The value can also be monitored in the INFO system (SYSTEM/#SYSTEM) or using Windows Task Manager. The sParams parameter is not used. "win.lang" - Returns the language of currently logged-in user in Windows OS.
The sParams parameter is not used. "win.rdp" - If the application is running via the remote desktop (RDP) then returns the 1 value, otherwise returns the 0 value.
The sParams parameter is not used. "win.username" - Returns the name of currently logged-in user in Windows OS.
The sParams parameter is not used. "app.lastuseracttime" - Returns the time of last user activity (keyboard or mouse). This method is also functional in Web panels.
This detection can be performed periodically and if the user inactivity reaches certain time then an action can be triggered (e.g. user logout). The sParams parameter is not used. See Example3. "app.laststopfailed" - Returns the true value if the last application stopping ended with an error, otherwise returns the false value. (See the pEvent.Reset parameter in the onAppStartBegin event).
The sParams parameter is not used. "net.addresses" - Returns an array of IP network addresses of this computer.
The sParams parameter in the KeyVal format specifies how the addresses are added into the array based on type. If not defined then all IPv4 and IPv6 addresses are returned (without localhost addresses). See Example2. "ipv4" (optional) - Specifies adding of IPv4 addresses into the array.
0 - No addresses of defined type are added.
1 (default) - Network addresses of defined type are added (without localhost).
2 - Adds localhost address 127.0.0.1 or ::1 according to defined type.
3 - Network and localhost addreses of defined type are added. "ipv6" (optional) - Specifies adding of IPv6 addresses into the array.
0 - No addresses of defined type are added.
1 (default) - Network addresses of defined type are added (without localhost).
2 - Adds localhost address 127.0.0.1 or ::1 according to defined type.
3 - Network and localhost addreses of defined type are added. "pm.platform" - Returns flag whether the PROMOTIC system is 32-bit (value 0) or 64-bit (value 1).
The sParams parameter is not used. "pm.version" - Returns version of the PROMOTIC system in the form for example "PROMOTIC9.0.31".
The sParams parameter is not used. |
---|---|
sParams | (String) Additional parameters for each operation. The meaning is different for each operation.
If the operation uses the parameter, then it is pointed by the operation. |
var nScreenX = Pm.GetSystemInfo("screen.width", "");
var nScreenY = Pm.GetSystemInfo("screen.height", "");
var aIpAddr = Pm.GetSystemInfo("net.addresses", "ipv4:1;ipv6:0;");
if (pMe.Root.ClientType == 2)
{
var nMinInactivity = 10;
// x minute
var nLastTimeActivity = Pm.GetSystemInfo("app.lastuseracttime", "");
var nTimeOut = Pm.Time - (1 / 24 / 60) * nMinInactivity;
if (nTimeOut > nLastTimeActivity)
{
Pm.Debug("Auto LogOff");
Pm.Logoff();
}
}
Pm.RtLang = Pm.GetSystemInfo("win.lang", "");