Skip to content

Commit

Permalink
Add a fallback value for Display.SerialNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
SaifAqqad committed Feb 23, 2024
1 parent e456fce commit c5f3c3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Lib/DisplayDevices.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Requires AutoHotkey v1.1.36+
#Requires AutoHotkey v1.1.36+

class DisplayDevices {
static _wmiPath := "winmgmts:{impersonationLevel=impersonate}!\\" A_ComputerName "\root\wmi"
Expand Down Expand Up @@ -115,7 +115,8 @@ class DisplayDevices {
return displaySerialNum
}

return ""
; Fallback to the UID from instance path
return RegExMatch(instance, "UID(\d+)", serialNum) ? serialNum : ""
}

class Display {
Expand Down

0 comments on commit c5f3c3e

Please sign in to comment.