Jump to content

Get Monitor Information


Recommended Posts

thank you for this rover!

ive been using this with some success...

can you or anyone else figure out a way i can get a more complete serial number? from what i could tell it only ouputs the last 8 characters (and the serial is in most cases what im seeing 14 characters)

good timing gcue :)

have you had a look at the serial length in the binary EDID in the registry?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\'YOUR VESA ID'\'MONITOR CODE'\Device Parameters\EDID

script needs an update, though still works without it

as of version 3.3.0.0 RegRead now returns binary instead of hex string

added Hex() to RegRead return.

tested with old Dell P992 with 12 digit serial number

try changing the For/Next loop count value in _FindMonitorSerial() (set to 13, try 20)

13 is probably the v1.3 EDID standard length for the serial, as the vb scripts in the above link uses 13

see the above post where Dell monitor serial numbers are shorter in the registry.

Edit: I just noticed my post count is 486. I feel like I have the clock speed of a 486 today... :party:

CODE
; Retrieve Monitor Model and Serial

; 13 November 2005 by Geert (NL)

; used parts made by archrival (http://www.autoitscript.com/forum/index.php?showtopic=11136)

; Edited/upgraded by rover 20 June 2008

; Collect EDID strings for all active monitors

;Links

;http://en.wikipedia.org/wiki/Extended_display_identification_data

;http://www.lavalys.com/forum/lofiversion/index.php/t1829.html

;http://cwashington.netreach.net/depo/view.asp?Index=1087&ScriptType=vbscript

#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

Opt("MustDeclareVars", 1)

;#include <Constants.au3>

; ConsoleWrites slow a script if not needed

Global $bDebug = True ; change to False or comment out/remove ConsoleWrite() lines if debugging to console not needed

Global $bDisplayAll = False ; if false only 'Active' monitors (reg entries with 'Control' key) with EDID info reported

; 'Active' monitors with no reported EDID data(serial, name, date) are ignored

Global $asEDID[1][2] = [[0, 0]]

Global $iCounterEDID = 0, $sResults

Global $edidarray[1], $error1, $error2, $error3

Global $iCounterMonitorName = 1, $iCounterMonitorCode, $iCounterMonitorControlFolder

Global $sMonitorName, $sMonitorCode, $sMonitorControlFolder, $bMonitorEDIDRead

Global $ser, $name, $j, $sManuDate, $sEDIDVer, $iExtended

Do

$sMonitorName = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY", $iCounterMonitorName)

$error1 = @error

If $bDebug Then ConsoleWrite(@CRLF & '@@ Debug(' & @ScriptLineNumber & ') : $sMonitorName = ' & _

StringStripWS($sMonitorName, 2) & @CRLF & '>Error code: ' & $error1 & @CRLF)

If $sMonitorName <> "" Then

$iCounterMonitorCode = 1

Do

; Search 'monitor code' - e.g. 5&3aba5caf&0&10000080&01&00

$sMonitorCode = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _

$sMonitorName, $iCounterMonitorCode)

$error2 = @error

If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorCode = ' & _

StringStripWS($sMonitorCode, 2) & @CRLF & '>Error code: ' & $error2 & @CRLF)

; Search Control folder - When available, the active monitor is found

$iCounterMonitorControlFolder = 1

Do

$sMonitorControlFolder = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _

$sMonitorName & "\" & $sMonitorCode, $iCounterMonitorControlFolder)

$error3 = @error

If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorControlFolder = ' & _

StringStripWS($sMonitorControlFolder, 2) & @CRLF & '>Error code: ' & $error3 & @CRLF)

If $sMonitorControlFolder == "Control" Then; Active monitor found!

Switch RegEnumVal("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & $sMonitorName & _

"\" & $sMonitorCode & "\Device Parameters", 1)

Case "EDID"

$bMonitorEDIDRead = RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _

$sMonitorName & "\" & $sMonitorCode & "\Device Parameters", "EDID")

$iExtended = @extended

If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $bMonitorEDIDRead = ' & _

$bMonitorEDIDRead & @CRLF & '>Error code: ' & @error & @CRLF & '>Extended code: ' & $iExtended & @CRLF)

;If $bMonitorEDIDRead <> "" And Not @error And $iExtended = $REG_BINARY Then

If $bMonitorEDIDRead <> "" And Not @error Then

$iCounterEDID += 1

$asEDID[0][0] = $iCounterEDID

ReDim $asEDID[uBound($asEDID) + 1][2]

; Add found EDID string to Array

$asEDID[uBound($asEDID) - 1][0] = Hex($bMonitorEDIDRead) ;(convert from binary to hex string: AutoIt v3.3.0.0 and higher)

$asEDID[uBound($asEDID) - 1][1] = $sMonitorName

EndIf

Case "BAD_EDID"

$iCounterEDID += 1

$asEDID[0][0] = $iCounterEDID

ReDim $asEDID[uBound($asEDID) + 1][2]

$asEDID[uBound($asEDID) - 1][0] = "BAD_EDID"; Add BAD_EDID string to Array

$asEDID[uBound($asEDID) - 1][1] = $sMonitorName

EndSwitch

EndIf

$iCounterMonitorControlFolder += 1; Increase counter to search for next folder

Until $error3 <> 0

$iCounterMonitorCode += 1; Increase counter to search for next 'monitor code' folder

Until $error2 <> 0

EndIf

$iCounterMonitorName += 1; Increase counter to search for next monitor

Until $error1 <> 0

; Extract info from collected EDID strings - Thanks archrival

If $asEDID[0][0] Then

For $k = 1 To $asEDID[0][0]

Switch $asEDID[$k][0]

Case "BAD_EDID"

If Not $bDisplayAll Then ContinueLoop

$ser = "BAD_EDID"

$name = "BAD_EDID"

Case Else

$j = 0

ReDim $edidarray[stringLen($asEDID[$k][0])]

$edidarray[0] = (StringLen($asEDID[$k][0]) / 2) + 1

For $i = 1 To StringLen($asEDID[$k][0]) Step 2

$j += 1

$edidarray[$j] = Dec(StringMid($asEDID[$k][0], $i, 2))

Next

$ser = StringStripWS(_FindMonitorSerial($edidarray), 1 + 2)

$name = StringStripWS(_FindMonitorName($edidarray), 1 + 2)

If $name <> "Not Found" Then

$sManuDate = StringStripWS(_FindMonitorManuDate($asEDID[$k][0]), 1 + 2)

$sEDIDVer = StringStripWS(_FindMonitorEDIDVer($asEDID[$k][0]), 1 + 2)

Else

$sManuDate = ""

$sEDIDVer = ""

EndIf

If Not $bDisplayAll Then

If $name = "Not Found" Then ContinueLoop

EndIf

EndSwitch

$sResults &= @CRLF & "Monitor #" & $k & @CRLF & "VESA Monitor ID" & @TAB & $asEDID[$k][1] & @CRLF & _

"Serial: " & @TAB & @TAB & $ser & @CRLF & "Name: " & @TAB & @TAB & $name & @CRLF & _

"ManuDate: " & @TAB & $sManuDate & @CRLF & "EDID: " & @TAB & @TAB & $sEDIDVer & @CRLF

Next

Else

; No EDID or BAD_EDID entries found

$sResults = "No Monitors Found"

EndIf

;Show MonitorSerial & MonitorName: no info? -> Your using a notebook right!

MsgBox(64, "Active Monitor EDID Info", $sResults)

Exit

#Region - Functions

Func _FindMonitorSerial(ByRef $aArray); Thanks archrival

If Not IsArray($aArray) Then Return

Local $sSernumstr = "", $iSernum = 0, $iEndstr = 0

For $i = 1 To (UBound($aArray) / 2) - 4

If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And $aArray[$i + 2] = "0" _

And $aArray[$i + 3] = "255" And $aArray[$i + 4] = "0" Then

$iSernum = $i + 4

EndIf

Next

If $iSernum Then

For $i = 1 To 13 ;try changing 13 to higher number

If $aArray[$iSernum + $i] = "10" Then

$iEndstr = 1

ElseIf Not $iEndstr Then

$sSernumstr &= Chr($aArray[$iSernum + $i])

EndIf

Next

Else

Return "Not Found"

EndIf

Return $sSernumstr

EndFunc ;==>_FindMonitorSerial

Func _FindMonitorName(ByRef $aArray); Thanks archrival

If Not IsArray($aArray) Then Return

Local $n = 0, $sNamestr = "", $iEndstr = 0

For $i = 1 To (UBound($aArray) / 2) - 4

If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And _

$aArray[$i + 2] = "252" And $aArray[$i + 3] = "0" Then

$n = $i + 3

EndIf

Next

If $n Then

For $i = 1 To 13

If $aArray[$n + $i] = "10" Then

$iEndstr = 1

ElseIf Not $iEndstr Then

$sNamestr &= Chr($aArray[$n + $i])

EndIf

Next

Else

Return "Not Found"

EndIf

Return $sNamestr

EndFunc ;==>_FindMonitorName

#EndRegion - Functions

Func _FindMonitorManuDate(ByRef $sEDID)

Local $wk, $yr

$wk = Dec(StringMid($sEDID, 33, 2)) ; 10h BYTE week number of manufacture

$yr = Dec(StringMid($sEDID, 35, 2)) + 1990 ; 11h BYTE manufacture year - 1990

If $wk = 0 Or $wk > 52 Or $yr < 2000 Or $yr > @YEAR Then

Return ""

EndIf

Return "Week " & $wk & "/" & $yr

EndFunc ;==>_FindMonitorManuDate

Func _FindMonitorEDIDVer(ByRef $sEDID)

Local $iEDIDVer, $iEDIDRev

$iEDIDVer = Dec(StringMid($sEDID, 37, 2)) ; 12h BYTE EDID version

$iEDIDRev = Dec(StringMid($sEDID, 39, 2)) ; 13h BYTE EDID revision

If $iEDIDVer < 1 Or $iEDIDRev < 2 Then

Return ""

EndIf

Return "v" & $iEDIDVer & "." & $iEDIDRev

EndFunc ;==>_FindMonitorEDIDVer

Edited by rover

I see fascists...

Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

heh funny i tried replacing 13 with 20 in the old script and the new one.. still getting 10 characters only =/

then that is the serial as stored in registry without the manufacturers prefix code

is it a Dell?

I see fascists...

Link to comment
Share on other sites

nah samsung.. hmm and it does say v1.3 hmm but the serial on the monitor is 14 chars...

post the prefix section of the monitor sticker serial missing from the registry serial

It may turn up results in a google search

probably the same as a Dell, the missing prefix is same for that model

Edit: to clarify, only the unique part of the serial number is stored, the sticker has a manufacturers prefix for that model added to the serial

Edited by rover

I see fascists...

Link to comment
Share on other sites

what are you doing with the dell prefix?

nothing at all

the EDID standard seems to be limited to 13 characters so manufacturers using a long serial number don't

write the entire thing into the monitors SEEPROM.

DumpEDID and the Entech utility mentioned earlier in this thread

show the same thing, you can get the serial straight from the monitor or read it from the registry

but you wont get the entire serial as shown on the monitor sticker

case in point: my off-lease surplus Dell P992 monitor - DumpEDID and Entech utilities report 12 digit serial, so does the registry

the monitors sticker shows a 20 character serial number, not counting hyphens

Registry and read from monitor utilities: 8D46621930GU

Sticker: MX-08D466-47741-219-30GU

the serial has a monitor model specific prefix and an additional number in the middle of the serial!

the industry standard seems to be no standard as I mentioned earlier in this thread

Edit: correction SEEPROM not EEPROM, typos

Edited by rover

I see fascists...

Link to comment
Share on other sites

  • 7 months later...
  • 1 month later...

Wondering if there is any way to identify whether a monitor is TFT/LCD or CRT?

Unfortunately I have to do some googling to determine the type of monitor given the monitor name.

Any help would be appreciated.

JCO

Edited by JCO
Link to comment
Share on other sites

  • 2 months later...

There is a bug in the Function "_FindMonitorName".

EDID allow mutible Discriptionblocks. A Sample :

EDID :

00ffffffffffff003ac4000e000000002d0c010380201400eaa8e099574b92251c5054000000010101010101010101010101010101016c2f90a0601a1e403020260042c910000018000000fc004e76696469612044656661756c000000fc007420466c61742050616e656c00000000fd00003c1d430d000020202020200000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Descriptor Block 1 : Pixel Clock

Descriptor Block 2 : Monitorname Part 1(Nvidia Defaul)

Descriptor Block 3 : Monitorname Part 2 (t Flat Panel)

Descriptor Block 4 : Monitor Range Limits

The old Version of the Function return : "t Flat Panel" the new Return : "Nvidia Default Flat Panel"

Func _FindMonitorName(ByRef $aArray); Thanks archrival
If Not IsArray($aArray) Then Return
Local $n = 0, $sNamestr = "", $iEndstr = 0
For $i = 1 To (UBound($aArray) / 2) - 4
If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And _
$aArray[$i + 2] = "252" And $aArray[$i + 3] = "0" Then
$n = $i + 3
For $in = 1 To 13
If $aArray[$n + $in] = "10" Then
$iEndstr = 1
ElseIf Not $iEndstr Then
$sNamestr &= Chr($aArray[$n + $in])
EndIf
Next
EndIf
Next
If Not $n Then
Return "Not Found"
EndIf
Return $sNamestr
EndFunc ;==>_FindMonitorName
Edited by MysticEmpires
Link to comment
Share on other sites

  • 6 months later...
  • 6 months later...
  • 2 years later...

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...