Simple function to get the current screen resolution.

function getScreenResolution=
(
    screen = (dotNetClass "System.Windows.Forms.Screen").PrimaryScreen.Bounds
    return #(screen.Width, screen.Height)
)
res = getScreenResolution()

/*This code prints
    getScreenResolution()
    #(1920, 1200)
*/

3 Comments

Tobbe · May 4, 2015 at 4:08 am

Thank you original poster for that handy function, exactly what I was looking for. Also thanks for Drathir for his addition, useful too. Much appreciated.

Drathir · September 22, 2014 at 8:04 am

sysInfo.desktopSize – quicker

    Kevin Gøhler · January 8, 2015 at 12:43 pm

    Most people have several screens, and sysInfo.desktopSize will return the collective size 🙂 But valid input none the less 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *