private uint ReadDCBrightness() { uint val = 0; WindowsSevenNativeFunctions.PowerReadDCValueIndex( IntPtr.Zero, ref currentPowerScheme, ref this.GUID_VIDEO_SUBGROUP, ref this.GUID_VIDEO_BRIGHTNESS, ref val); return(val); }
public static Guid GetActivePowerScheme() { IntPtr ptrActiveGuid = IntPtr.Zero; uint res = WindowsSevenNativeFunctions.PowerGetActiveScheme(IntPtr.Zero, ref ptrActiveGuid); if (res != 0) { throw new Exception("Error reading current power scheme. Native Win32 error code = " + res); } var activeSchemeGuid = (Guid)Marshal.PtrToStructure(ptrActiveGuid, typeof(Guid)); return(activeSchemeGuid); }