Save lid action to config file during startup if user has set it to hibernate or shutdown.

This commit is contained in:
IceStormNG
2023-07-26 23:15:28 +02:00
parent e16a50f1f2
commit cff2c9af0b
2 changed files with 44 additions and 0 deletions

View File

@@ -167,6 +167,28 @@ namespace GHelper.Mode
}
}
public static int GetLidAction(bool ac)
{
Guid activeSchemeGuid = GetActiveScheme();
IntPtr activeIndex;
if (ac)
PowerReadACValueIndex(IntPtr.Zero,
activeSchemeGuid,
GUID_SYSTEM_BUTTON_SUBGROUP,
GUID_LIDACTION, out activeIndex);
else
PowerReadDCValueIndex(IntPtr.Zero,
activeSchemeGuid,
GUID_SYSTEM_BUTTON_SUBGROUP,
GUID_LIDACTION, out activeIndex);
return activeIndex.ToInt32();
}
public static void SetLidAction(int action, bool acOnly = false)
{
/**