@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Queries for a group policy override for specified power settings. !!!!C# Signature: /* http://msdn2.microsoft.com/en-us/library/aa372761.aspx */ /// <summary> /// Full call to Vista method PowerSettingAccessCheck(). /// </summary> /// <param name="accessFlags">One or more check specifier flags</param> /// <param name="powerGuid">The relevant Power Policy GUID</param> /// <returns></returns> [DllImport("PowrProf.dll", CharSet = CharSet.Auto, SetLastError = true)] [return: MarshalAs(UnmanagedType.U4)] internal static extern UInt32 PowerSettingAccessCheck( PowerSettingAccessFlags accessFlags, [MarshalAs(UnmanagedType.LPStruct)] Guid powerGuid ); /// <summary> /// Partial call to Vista method PowerSettingAccessCheck() supporting null GUID parameter. /// </summary> /// <param name="accessFlags">One or more check specifier flags</param> /// <param name="powerGuid">null</param> /// <returns></returns> [DllImport("PowrProf.dll", CharSet = CharSet.Auto, SetLastError = true)] [return: MarshalAs(UnmanagedType.U4)] private static extern UInt32 PowerSettingAccessCheck( PowerSettingAccessFlags accessFlags, IntPtr powerGuid ); /// <summary> /// Full call to Vista method PowerSettingAccessCheck() supporting empty power setting identifier. /// </summary> /// <param name="accessFlags">One or more check specifier flags</param> /// <returns></returns> internal static UInt32 PowerSettingAccessCheck(PowerSettingAccessFlags accessFlags) { return PowerSettingAccessCheck(accessFlags, IntPtr.Zero); } #region Group Policy Access FlagsAttribute [Flags] public enum PowerSettingAccessFlags { /// <summary> /// Check for overrides on AC power settings. /// </summary> ACCESS_AC_POWER_SETTING_INDEX = 0x0, /// <summary> /// Check for overrides on DC power settings. /// </summary> ACCESS_DC_POWER_SETTING_INDEX = 0x1, /// <summary> /// Check for restrictions on specific power schemes. /// </summary> ACCESS_SCHEME = 0x10, /// <summary> /// Check for restrictions on active power schemes. /// </summary> ACCESS_ACTIVE_SCHEME = 0x13, /// <summary> /// Check for restrictions on creating or restoring power schemes. /// </summary> ACCESS_CREATE_SCHEME = 0x14 }; #endregion !!!!VB Signature: Declare Function PowerSettingAccessCheck Lib "powrprof.dll" (TODO) As TODO !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: This function is only available from Vista. !!!!Tips & Tricks: Please add some! !!!!Sample Code: Please add some! Documentation: PowerSettingAccessCheck@msdn on MSDN
Edit powrprof.PowerSet...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.