Jump to content

Find Display Resolution


Chimaera
 Share

Recommended Posts

Here's a little something back to the community for all the help I've had since I've been here

It took me quite a while to research all the modes, but its a fairly complete list up to and including the latest types that will come along as the price for some of these monitors drops to normal human buying power.

I've gone for the complete list so that in years to come it should still be valid.

Ive commented all the resolutions so you can see what they are.

If on the rare chance someone uses it gimme a credit plz :)

#cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.6.1
    Author:         Chimaera

    Script Function: Desktop Resolution
#ce ----------------------------------------------------------------------------
Global $resolution
; ------------------------------------------------------------------------------

MsgBox(0, "Desktop Resolution", _Desktop_Resolution() & " @ " & @DesktopRefresh & " Hertz")


Func _Desktop_Resolution()
    Switch $resolution = ""
        Case @DesktopWidth = 640 And @DesktopHeight = 480;      Video Graphics Array
            $resolution = "640 x 480 (4:3) VGA"
        Case @DesktopWidth = 800 And @DesktopHeight = 480;      Wide Video Graphics Array
            $resolution = "800 x 480 (4:3) WVGA"
        Case @DesktopWidth = 854 And @DesktopHeight = 480;      Full Wide Video Graphics Array
            $resolution = "854 x 480 (4:3) FWVGA"
        Case @DesktopWidth = 800 And @DesktopHeight = 600;      Super Video Graphics Array
            $resolution = "800 x 600 (4:3) SVGA"
        Case @DesktopWidth = 960 And @DesktopHeight = 540;      Quarter Full HD
            $resolution = "960 x 540 (16:9) qHD"
        Case @DesktopWidth = 1024 And @DesktopHeight = 576;     Wide Super Video Graphics Array
            $resolution = "1024 x 576 (5:3) WSVGA"
        Case @DesktopWidth = 1024 And @DesktopHeight = 600;     Wide Super Video Graphics Array
            $resolution = "1024 x 600 (5:3) WSVGA"
        Case @DesktopWidth = 1024 And @DesktopHeight = 768;     eXtended Graphics Array
            $resolution = "1024 x 768 (4:3) XGA"
        Case @DesktopWidth = 1152 And @DesktopHeight = 864;     eXtended Graphics Array Plus
            $resolution = "1152 x 864 (4:3) XGA+"
        Case @DesktopWidth = 1280 And @DesktopHeight = 720;     Wide eXtended Graphics Array
            $resolution = "1280 x 720 (16:9) HD Ready"
        Case @DesktopWidth = 1280 And @DesktopHeight = 768;     Wide eXtended Graphics Array
            $resolution = "1280 x 768 (15:9) WXGA"
        Case @DesktopWidth = 1280 And @DesktopHeight = 800;     Wide eXtended Graphics Array
            $resolution = "1280 x 800 (16:10) WXGA"
        Case @DesktopWidth = 1280 And @DesktopHeight = 960;     Super eXtended Graphics Array
            $resolution = "1280 x 960 (4:3) SXGA"
        Case @DesktopWidth = 1280 And @DesktopHeight = 1024;    Super eXtended Graphics Array
            $resolution = "1280 x 1024 (5:4) SXGA"
        Case @DesktopWidth = 1360 And @DesktopHeight = 768;     Wide eXtended Graphics Array
            $resolution = "1360 x 768 (16:9) WXGA"
        Case @DesktopWidth = 1366 And @DesktopHeight = 768;     High Definition (720p)
            $resolution = "1366 x 768 (16:9) HD [720p]"
        Case @DesktopWidth = 1440 And @DesktopHeight = 900;     Wide Super eXtended Graphics Array
            $resolution = "1440 x 900 (16:10) WSXGA"
        Case @DesktopWidth = 1400 And @DesktopHeight = 1050;    Wide Super eXtended Graphics Array
            $resolution = "1440 x 900 (16:10) WSXGA"
        Case @DesktopWidth = 1600 And @DesktopHeight = 900;     High Definition Plus (900p)
            $resolution = "1600 x 900 (16:9) HD+ [900p]"
        Case @DesktopWidth = 1600 And @DesktopHeight = 1200;    Ultra eXtended Graphics Array
            $resolution = "1600 x 1200 (4:3) UXGA"
        Case @DesktopWidth = 1680 And @DesktopHeight = 1050;    Wide Super eXtended Graphics Array Plus
            $resolution = "1680 x 1050 (16:10) WSXGA+"
        Case @DesktopWidth = 1920 And @DesktopHeight = 1080;    Full High Definition (1080p)
            $resolution = "1920 x 1080 (16:9) HD [1080p]"
        Case @DesktopWidth = 1920 And @DesktopHeight = 1200;    Wide Ultra eXtended Graphics Array
            $resolution = "1920 x 1200 (16:10) WUXGA"
        Case @DesktopWidth = 1920 And @DesktopHeight = 1400;    Tesselar eXtended Graphics Array
            $resolution = "1920 x 1400 (48:35) TXGA"
        Case @DesktopWidth = 2048 And @DesktopHeight = 1080;    Digital Film Projection
            $resolution = "2048 x 1080 (19:10) 2K"
        Case @DesktopWidth = 2048 And @DesktopHeight = 1152;    Quad Wide eXtended Graphics Array
            $resolution = "2048 x 1152 (4:3) QWXGA"
        Case @DesktopWidth = 2048 And @DesktopHeight = 1536;    Quad eXtended Graphics Array
            $resolution = "2048 x 1536 (4:3) QXGA"
        Case @DesktopWidth = 2538 And @DesktopHeight = 1080;    Wide Projector
            $resolution = "2538 x 1080 (47:20) Wide Projector"
        Case @DesktopWidth = 2560 And @DesktopHeight = 1080;    Cinema TV
            $resolution = "2560 x 1080 (64:27) Cinema TV"
        Case @DesktopWidth = 2560 And @DesktopHeight = 1440;    Wide Quad High Definition
            $resolution = "2560 x 1440 (16:9) WQHD"
        Case @DesktopWidth = 2560 And @DesktopHeight = 1600;    Wide Quad eXtended Graphics Array
            $resolution = "2560 x 1600 (16:10) WQXGA"
        Case @DesktopWidth = 2560 And @DesktopHeight = 2048;    Quad Super eXtended Graphics Array
            $resolution = "2560 x 2048 (5:4) QSXGA"
        Case @DesktopWidth = 2880 And @DesktopHeight = 900;     Dell Alienware
            $resolution = "2880 x 900 (16:5) Curved Display"
        Case @DesktopWidth = 3200 And @DesktopHeight = 2048;    Wide Quad Super eXtended Graphics Array
            $resolution = "3200 x 2048 (25:16) WQSXGA"
        Case @DesktopWidth = 3200 And @DesktopHeight = 2400;    Quad Ultra eXtended Graphics Array
            $resolution = "3200 x 2048 (4:3) QUXGA"
        Case @DesktopWidth = 3840 And @DesktopHeight = 2160;    Quad Full High Definition
            $resolution = "3840 x 2160 (16:9) QFHD"
        Case @DesktopWidth = 3840 And @DesktopHeight = 2400;    Wide Quad Ultra eXtended Graphics Array
            $resolution = "3840 x 2048 (16:10) WQUXGA"
        Case @DesktopWidth = 4096 And @DesktopHeight = 1716;    Digital Film Projection
            $resolution = "4096 x 1716 (2:39) 4K"
        Case @DesktopWidth = 4096 And @DesktopHeight = 3072;    Hex[adecatuple] eXtended Graphics Array
            $resolution = "4096 x 3072 (4:3) HXGA"
        Case @DesktopWidth = 5120 And @DesktopHeight = 3200;    Wide Hex[adecatuple] Extended Graphics Array
            $resolution = "5120 x 3200 (16:10) WHXGA"
        Case @DesktopWidth = 5120 And @DesktopHeight = 4096;    Hex[adecatuple] Super eXtended Graphics Array
            $resolution = "5120 x 4096 (5:4) HSXGA"
        Case @DesktopWidth = 6400 And @DesktopHeight = 4096;    Wide Hex[adecatuple] Super eXtended Graphics Array
            $resolution = "6400 x 4096 (25:16) WHSXGA"
        Case @DesktopWidth = 6400 And @DesktopHeight = 4800;    Hex[adecatuple] Ultra eXtended Graphics Array
            $resolution = "6400 x 4800 (4:3) HUXGA"
        Case @DesktopWidth = 7680 And @DesktopHeight = 4320;    Ultra High Definition Television
            $resolution = "7680 x 4320 (16:9) UHDT"
        Case @DesktopWidth = 7680 And @DesktopHeight = 4800;    Wide Hex[adecatuple] Ultra eXtended Graphics Array
            $resolution = "7680 x 4800 (16:10) WHUXGA"
        Case Else
            Return SetError(1, 0, $resolution)
    EndSwitch
    Return $resolution
EndFunc   ;==>_Desktop_Resolution

Enjoy

Chimaera

Link to comment
Share on other sites

  • 3 years later...

You might want to revise this code, as you're using the switch statement incorrectly. This should be an if...else if block OR select instead. You also don't need the Global variable.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Now that's late feedback  :shifty:

It's better than not, don't you agree!

Here is what I meant, with a slight performance fix:

#cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.12.0
    Author: Chimaera

    Script Function: Desktop Resolution
#ce ----------------------------------------------------------------------------
#include <MsgBoxConstants.au3> ; Only required for the MsgBox constant

MsgBox($MB_SYSTEMMODAL, "Desktop Resolution", _Desktop_Resolution() & " @ " & @DesktopRefresh & " Hertz")

Func _Desktop_Resolution()
    Local $iDesktopWidth = @DesktopWidth, $iDesktopHeight = @DesktopHeight ; Slight speed increase by storing in variables
    Select
        Case $iDesktopWidth = 640 And $iDesktopHeight = 480 ; Video Graphics Array
            Return "640 x 480 (4:3) VGA"
        Case $iDesktopWidth = 800 And $iDesktopHeight = 480 ; Wide Video Graphics Array
            Return "800 x 480 (4:3) WVGA"
        Case $iDesktopWidth = 854 And $iDesktopHeight = 480 ; Full Wide Video Graphics Array
            Return "854 x 480 (4:3) FWVGA"
        Case $iDesktopWidth = 800 And $iDesktopHeight = 600 ; Super Video Graphics Array
            Return "800 x 600 (4:3) SVGA"
        Case $iDesktopWidth = 960 And $iDesktopHeight = 540 ; Quarter Full HD
            Return "960 x 540 (16:9) qHD"
        Case $iDesktopWidth = 1024 And $iDesktopHeight = 576; Wide Super Video Graphics Array
            Return "1024 x 576 (5:3) WSVGA"
        Case $iDesktopWidth = 1024 And $iDesktopHeight = 600 ; Wide Super Video Graphics Array
            Return "1024 x 600 (5:3) WSVGA"
        Case $iDesktopWidth = 1024 And $iDesktopHeight = 768; eXtended Graphics Array
            Return "1024 x 768 (4:3) XGA"
        Case $iDesktopWidth = 1152 And $iDesktopHeight = 864; eXtended Graphics Array Plus
            Return "1152 x 864 (4:3) XGA+"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 720 ; Wide eXtended Graphics Array
            Return "1280 x 720 (16:9) HD Ready"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 768; Wide eXtended Graphics Array
            Return "1280 x 768 (15:9) WXGA"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 800 ; Wide eXtended Graphics Array
            Return "1280 x 800 (16:10) WXGA"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 960 ; Super eXtended Graphics Array
            Return "1280 x 960 (4:3) SXGA"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 1024; Super eXtended Graphics Array
            Return "1280 x 1024 (5:4) SXGA"
        Case $iDesktopWidth = 1360 And $iDesktopHeight = 768; Wide eXtended Graphics Array
            Return "1360 x 768 (16:9) WXGA"
        Case $iDesktopWidth = 1366 And $iDesktopHeight = 768; High Definition (720p)
            Return "1366 x 768 (16:9) HD [720p]"
        Case $iDesktopWidth = 1440 And $iDesktopHeight = 900 ; Wide Super eXtended Graphics Array
            Return "1440 x 900 (16:10) WSXGA"
        Case $iDesktopWidth = 1400 And $iDesktopHeight = 1050 ; Wide Super eXtended Graphics Array
            Return "1440 x 900 (16:10) WSXGA"
        Case $iDesktopWidth = 1600 And $iDesktopHeight = 900 ; High Definition Plus (900p)
            Return "1600 x 900 (16:9) HD+ [900p]"
        Case $iDesktopWidth = 1600 And $iDesktopHeight = 1200 ; Ultra eXtended Graphics Array
            Return "1600 x 1200 (4:3) UXGA"
        Case $iDesktopWidth = 1680 And $iDesktopHeight = 1050 ; Wide Super eXtended Graphics Array Plus
            Return "1680 x 1050 (16:10) WSXGA+"
        Case $iDesktopWidth = 1920 And $iDesktopHeight = 1080 ; Full High Definition (1080p)
            Return "1920 x 1080 (16:9) HD [1080p]"
        Case $iDesktopWidth = 1920 And $iDesktopHeight = 1200 ; Wide Ultra eXtended Graphics Array
            Return "1920 x 1200 (16:10) WUXGA"
        Case $iDesktopWidth = 1920 And $iDesktopHeight = 1400 ; Tesselar eXtended Graphics Array
            Return "1920 x 1400 (48:35) TXGA"
        Case $iDesktopWidth = 2048 And $iDesktopHeight = 1080 ; Digital Film Projection
            Return "2048 x 1080 (19:10) 2K"
        Case $iDesktopWidth = 2048 And $iDesktopHeight = 1152; Quad Wide eXtended Graphics Array
            Return "2048 x 1152 (4:3) QWXGA"
        Case $iDesktopWidth = 2048 And $iDesktopHeight = 1536 ; Quad eXtended Graphics Array
            Return "2048 x 1536 (4:3) QXGA"
        Case $iDesktopWidth = 2538 And $iDesktopHeight = 1080 ; Wide Projector
            Return "2538 x 1080 (47:20) Wide Projector"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 1080 ; Cinema TV
            Return "2560 x 1080 (64:27) Cinema TV"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 1440 ; Wide Quad High Definition
            Return "2560 x 1440 (16:9) WQHD"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 1600 ; Wide Quad eXtended Graphics Array
            Return "2560 x 1600 (16:10) WQXGA"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 2048 ; Quad Super eXtended Graphics Array
            Return "2560 x 2048 (5:4) QSXGA"
        Case $iDesktopWidth = 2880 And $iDesktopHeight = 900 ; Dell Alienware
            Return "2880 x 900 (16:5) Curved Display"
        Case $iDesktopWidth = 3200 And $iDesktopHeight = 2048 ; Wide Quad Super eXtended Graphics Array
            Return "3200 x 2048 (25:16) WQSXGA"
        Case $iDesktopWidth = 3200 And $iDesktopHeight = 2400 ; Quad Ultra eXtended Graphics Array
            Return "3200 x 2048 (4:3) QUXGA"
        Case $iDesktopWidth = 3840 And $iDesktopHeight = 2160 ; Quad Full High Definition
            Return "3840 x 2160 (16:9) QFHD"
        Case $iDesktopWidth = 3840 And $iDesktopHeight = 2400 ; Wide Quad Ultra eXtended Graphics Array
            Return "3840 x 2048 (16:10) WQUXGA"
        Case $iDesktopWidth = 4096 And $iDesktopHeight = 1716 ; Digital Film Projection
            Return "4096 x 1716 (2:39) 4K"
        Case $iDesktopWidth = 4096 And $iDesktopHeight = 3072 ; Hex[adecatuple] eXtended Graphics Array
            Return "4096 x 3072 (4:3) HXGA"
        Case $iDesktopWidth = 5120 And $iDesktopHeight = 3200 ; Wide Hex[adecatuple] Extended Graphics Array
            Return "5120 x 3200 (16:10) WHXGA"
        Case $iDesktopWidth = 5120 And $iDesktopHeight = 4096 ; Hex[adecatuple] Super eXtended Graphics Array
            Return "5120 x 4096 (5:4) HSXGA"
        Case $iDesktopWidth = 6400 And $iDesktopHeight = 4096 ; Wide Hex[adecatuple] Super eXtended Graphics Array
            Return "6400 x 4096 (25:16) WHSXGA"
        Case $iDesktopWidth = 6400 And $iDesktopHeight = 4800 ; Hex[adecatuple] Ultra eXtended Graphics Array
            Return "6400 x 4800 (4:3) HUXGA"
        Case $iDesktopWidth = 7680 And $iDesktopHeight = 4320 ; Ultra High Definition Television
            Return "7680 x 4320 (16:9) UHDT"
        Case $iDesktopWidth = 7680 And $iDesktopHeight = 4800 ; Wide Hex[adecatuple] Ultra eXtended Graphics Array
            Return "7680 x 4800 (16:10) WHUXGA"
        Case Else ; If nothing matches then return the following
            Return SetError(1, 0, "")
    EndSelect
EndFunc   ;==>_Desktop_Resolution
Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...

This topic will be legendary late in the year 2147. lol

Another late entry. 

Just replying to thank Chimaera, because that is usefull as air,  and help me a lot. So, thank you man. And thank you to guinness, for improve the  code.

Link to comment
Share on other sites

  • 4 years later...

@guinness thanks for this nice script. If i use this in VMWare, then the resolution varies sometimes. so is it possible to declare something like " Case $iDesktopWidth >= 1600 to <=1900 And $iDesktopHeight >= 900 to  <= 1000 ", if possible please help. i did try but not getting proper way. :(

Thanks in advance

#cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.12.0
    Author: Chimaera

    Script Function: Desktop Resolution
#ce ----------------------------------------------------------------------------
#include <MsgBoxConstants.au3> ; Only required for the MsgBox constant

MsgBox($MB_SYSTEMMODAL, "Desktop Resolution", _Desktop_Resolution() & " @ " & @DesktopRefresh & " Hertz")

Func _Desktop_Resolution()
    Local $iDesktopWidth = @DesktopWidth, $iDesktopHeight = @DesktopHeight ; Slight speed increase by storing in variables
    Select
        Case $iDesktopWidth = 640 And $iDesktopHeight = 480 ; Video Graphics Array
            Return "640 x 480 (4:3) VGA"
        Case $iDesktopWidth = 800 And $iDesktopHeight = 480 ; Wide Video Graphics Array
            Return "800 x 480 (4:3) WVGA"
        Case $iDesktopWidth = 854 And $iDesktopHeight = 480 ; Full Wide Video Graphics Array
            Return "854 x 480 (4:3) FWVGA"
        Case $iDesktopWidth = 800 And $iDesktopHeight = 600 ; Super Video Graphics Array
            Return "800 x 600 (4:3) SVGA"
        Case $iDesktopWidth = 960 And $iDesktopHeight = 540 ; Quarter Full HD
            Return "960 x 540 (16:9) qHD"
        Case $iDesktopWidth = 1024 And $iDesktopHeight = 576; Wide Super Video Graphics Array
            Return "1024 x 576 (5:3) WSVGA"
        Case $iDesktopWidth = 1024 And $iDesktopHeight = 600 ; Wide Super Video Graphics Array
            Return "1024 x 600 (5:3) WSVGA"
        Case $iDesktopWidth = 1024 And $iDesktopHeight = 768; eXtended Graphics Array
            Return "1024 x 768 (4:3) XGA"
        Case $iDesktopWidth = 1152 And $iDesktopHeight = 864; eXtended Graphics Array Plus
            Return "1152 x 864 (4:3) XGA+"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 720 ; Wide eXtended Graphics Array
            Return "1280 x 720 (16:9) HD Ready"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 768; Wide eXtended Graphics Array
            Return "1280 x 768 (15:9) WXGA"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 800 ; Wide eXtended Graphics Array
            Return "1280 x 800 (16:10) WXGA"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 960 ; Super eXtended Graphics Array
            Return "1280 x 960 (4:3) SXGA"
        Case $iDesktopWidth = 1280 And $iDesktopHeight = 1024; Super eXtended Graphics Array
            Return "1280 x 1024 (5:4) SXGA"
        Case $iDesktopWidth = 1360 And $iDesktopHeight = 768; Wide eXtended Graphics Array
            Return "1360 x 768 (16:9) WXGA"
        Case $iDesktopWidth = 1366 And $iDesktopHeight = 768; High Definition (720p)
            Return "1366 x 768 (16:9) HD [720p]"
        Case $iDesktopWidth = 1440 And $iDesktopHeight = 900 ; Wide Super eXtended Graphics Array
            Return "1440 x 900 (16:10) WSXGA"
        Case $iDesktopWidth = 1400 And $iDesktopHeight = 1050 ; Wide Super eXtended Graphics Array
            Return "1440 x 900 (16:10) WSXGA"
        Case $iDesktopWidth = 1600 And $iDesktopHeight = 900 ; High Definition Plus (900p)
            Return "1600 x 900 (16:9) HD+ [900p]"
        Case $iDesktopWidth = 1600 And $iDesktopHeight = 1200 ; Ultra eXtended Graphics Array
            Return "1600 x 1200 (4:3) UXGA"
        Case $iDesktopWidth = 1680 And $iDesktopHeight = 1050 ; Wide Super eXtended Graphics Array Plus
            Return "1680 x 1050 (16:10) WSXGA+"
        Case $iDesktopWidth = 1920 And $iDesktopHeight = 1080 ; Full High Definition (1080p)
            Return "1920 x 1080 (16:9) HD [1080p]"
        Case $iDesktopWidth = 1920 And $iDesktopHeight = 1200 ; Wide Ultra eXtended Graphics Array
            Return "1920 x 1200 (16:10) WUXGA"
        Case $iDesktopWidth = 1920 And $iDesktopHeight = 1400 ; Tesselar eXtended Graphics Array
            Return "1920 x 1400 (48:35) TXGA"
        Case $iDesktopWidth = 2048 And $iDesktopHeight = 1080 ; Digital Film Projection
            Return "2048 x 1080 (19:10) 2K"
        Case $iDesktopWidth = 2048 And $iDesktopHeight = 1152; Quad Wide eXtended Graphics Array
            Return "2048 x 1152 (4:3) QWXGA"
        Case $iDesktopWidth = 2048 And $iDesktopHeight = 1536 ; Quad eXtended Graphics Array
            Return "2048 x 1536 (4:3) QXGA"
        Case $iDesktopWidth = 2538 And $iDesktopHeight = 1080 ; Wide Projector
            Return "2538 x 1080 (47:20) Wide Projector"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 1080 ; Cinema TV
            Return "2560 x 1080 (64:27) Cinema TV"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 1440 ; Wide Quad High Definition
            Return "2560 x 1440 (16:9) WQHD"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 1600 ; Wide Quad eXtended Graphics Array
            Return "2560 x 1600 (16:10) WQXGA"
        Case $iDesktopWidth = 2560 And $iDesktopHeight = 2048 ; Quad Super eXtended Graphics Array
            Return "2560 x 2048 (5:4) QSXGA"
        Case $iDesktopWidth = 2880 And $iDesktopHeight = 900 ; Dell Alienware
            Return "2880 x 900 (16:5) Curved Display"
        Case $iDesktopWidth = 3200 And $iDesktopHeight = 2048 ; Wide Quad Super eXtended Graphics Array
            Return "3200 x 2048 (25:16) WQSXGA"
        Case $iDesktopWidth = 3200 And $iDesktopHeight = 2400 ; Quad Ultra eXtended Graphics Array
            Return "3200 x 2048 (4:3) QUXGA"
        Case $iDesktopWidth = 3840 And $iDesktopHeight = 2160 ; Quad Full High Definition
            Return "3840 x 2160 (16:9) QFHD"
        Case $iDesktopWidth = 3840 And $iDesktopHeight = 2400 ; Wide Quad Ultra eXtended Graphics Array
            Return "3840 x 2048 (16:10) WQUXGA"
        Case $iDesktopWidth = 4096 And $iDesktopHeight = 1716 ; Digital Film Projection
            Return "4096 x 1716 (2:39) 4K"
        Case $iDesktopWidth = 4096 And $iDesktopHeight = 3072 ; Hex[adecatuple] eXtended Graphics Array
            Return "4096 x 3072 (4:3) HXGA"
        Case $iDesktopWidth = 5120 And $iDesktopHeight = 3200 ; Wide Hex[adecatuple] Extended Graphics Array
            Return "5120 x 3200 (16:10) WHXGA"
        Case $iDesktopWidth = 5120 And $iDesktopHeight = 4096 ; Hex[adecatuple] Super eXtended Graphics Array
            Return "5120 x 4096 (5:4) HSXGA"
        Case $iDesktopWidth = 6400 And $iDesktopHeight = 4096 ; Wide Hex[adecatuple] Super eXtended Graphics Array
            Return "6400 x 4096 (25:16) WHSXGA"
        Case $iDesktopWidth = 6400 And $iDesktopHeight = 4800 ; Hex[adecatuple] Ultra eXtended Graphics Array
            Return "6400 x 4800 (4:3) HUXGA"
        Case $iDesktopWidth = 7680 And $iDesktopHeight = 4320 ; Ultra High Definition Television
            Return "7680 x 4320 (16:9) UHDT"
        Case $iDesktopWidth = 7680 And $iDesktopHeight = 4800 ; Wide Hex[adecatuple] Ultra eXtended Graphics Array
            Return "7680 x 4800 (16:10) WHUXGA"
        Case Else ; If nothing matches then return the following
            Return SetError(1, 0, "")
    EndSelect
EndFunc   ;==>_Desktop_Resolution
Link to comment
Share on other sites

  • Moderators

@ashraful089Just put your Select into parentheses. Like this (pseudo):

Case ($a >= xxx And $a <= xxx) And ($b >= xxx And $b <= xxx)
    .....

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...