Кроме напрашивающегося самим собой способа, например:
Code: Select all
#Requires Autohotkey v2.0
szGUID := 16, Schemes := [], ActiveScheme := Buffer(szGUID)
Loop
{
r := DllCall('powrprof.dll\PowerEnumerate', 'Ptr', 0, 'Ptr', 0, 'Ptr', 0, 'UInt', 16, 'UInt', A_Index - 1, 'Ptr', GUID := Buffer(szGUID), 'PtrP', &szGUID)
If r != 0
Break
Schemes.Push(GUID)
}
DllCall('powrprof.dll\PowerGetActiveScheme', 'Ptr', 0, 'PtrP', &ptrActive := 0)
NumPut('Int64', NumGet(ptrActive, 'Int64'), 'Int64', NumGet(ptrActive, 8, 'Int64'), ActiveScheme)
DllCall('LocalFree', 'Ptr', ptrActive)
Loop Schemes.Length
{
If CompareGUID(ActiveScheme, Schemes[A_Index])
MsgBox('Bingo!')
}
CompareGUID(p1, p2) => (NumGet(p1, 'Int64') = NumGet(p2, 'Int64') && NumGet(p1, 8, 'Int64') = NumGet(p2, 8, 'Int64'))