From c5f3c3ef59187869deaeb08184ecebfe7cfbb2bc Mon Sep 17 00:00:00 2001 From: Saif Alaqqad Date: Fri, 23 Feb 2024 09:01:29 +0300 Subject: [PATCH] Add a fallback value for Display.SerialNumber --- src/Lib/DisplayDevices.ahk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Lib/DisplayDevices.ahk b/src/Lib/DisplayDevices.ahk index db42cfa..cec836d 100644 --- a/src/Lib/DisplayDevices.ahk +++ b/src/Lib/DisplayDevices.ahk @@ -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" @@ -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 {