Tutorial: system.getMonitorInfo

system.getMonitorInfo

Retrieves an object that contains data about the monitor setup of the computer that the runtime is running on.

Example

fin.desktop.System.getMonitorInfo(function (monitorInfo) {
    console.log("This object contains information about all monitors: ", monitorInfo);
});

Monitor Info

//This response has the following shape:
{
    nonPrimaryMonitors: [{
        availableRect: {
            bottom: 55, //bottom-most available monitor coordinate
            left: 55, //left-most available monitor coordinate
            right: 55, //right-most available monitor coordinate
            top: 55 //top-most available monitor coordinate
        },
        deviceId: "device", //device id of the display,
        displayDeviceActive: true, //true if the display is active
        monitorRect: {
            bottom: 55, //bottom-most monitor coordinate
            left: 55, //left-most monitor coordinate
            right: 55, //right-most monitor coordinate
            top: 55 //top-most monitor coordinate
        },
        name: "displayName" //name of the display
    }],
    primaryMonitor: {
        availableRect: {
            bottom: 55, //bottom-most available monitor coordinate
            left: 55, //left-most available monitor coordinate
            right: 55, //right-most available monitor coordinate
            top: 55 //top-most available monitor coordinate
        },
        deviceId: "device", //device id of the display,
        displayDeviceActive: true, //true if the display is active
        monitorRect: {
            bottom: 55, //bottom-most monitor coordinate
            left: 55, //left-most monitor coordinate
            right: 55, //right-most monitor coordinate
            top: 55 //top-most monitor coordinate
        },
        name: "displayName" //name of the display
    },
    reason: "api-query", //always "api-query",
    taskbar: {
        edge: "edge", //which edge of a monitor the taskbar is on
        rect: {
            bottom: 55, //bottom-most coordinate of the taskbar
            left: 55, //left-most coordinate of the taskbar
            right: 55, //right-most coordinate of the taskbar
            top: 55 //top-most coordinate of the taskbar
        }
    },
    virtualScreen: {
        bottom: 55, //bottom-most coordinate of the virtual screen,
        left: 55, //left-most coordinate of the virtual screen,
        right: 55, //right-most coordinate of the virtual screen,
        top: 55 //top-most coordinate of the virtual screen
    }
}