You can do something like this :
(I assume in this test that DarK/Light theme is not changed several times in <5 seconds)
<DllImport("Kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)>
Public Shared Function GetTickCount() As UInteger
End Function
Dim nTicksOld As UInteger = 0
Protected Overrides Sub WndProc(ByRef MSG As Message)
If (MSG.Msg = WM_SETTINGCHANGE AndAlso MSG.LParam <> IntPtr.Zero AndAlso Marshal.PtrToStringAuto(MSG.LParam) = "ImmersiveColorSet") Then
Dim nTicks = GetTickCount()
If (nTicks - nTicksOld > 5000 Or nTicksOld = 0) Then
Console.Beep(5000, 10)
End If
nTicksOld = nTicks
Else
MyBase.WndProc(MSG)
End If
End Sub