I have the following code to set the password prompt after suspend, which has been working fine in XP, but in Vista the SetActivePwrScheme() call causes the current power scheme settings to reset to defaults. Is this a bug, or has something changed?
BOOL PasswordPromptAfterSuspend(BOOL fEnable) { GLOBAL_POWER_POLICY sGlobalPwrPolicy; BOOL fResult = false;
if(CanUserWritePwrScheme()) { if(ReadGlobalPwrPolicy(&sGlobalPwrPolicy)) { if(fEnable) sGlobalPwrPolicy.user.GlobalFlags |= EnablePasswordLogon; else sGlobalPwrPolicy.user.GlobalFlags &= ~EnablePasswordLogon;
if(WriteGlobalPwrPolicy(&sGlobalPwrPolicy)) { UINT uActivePwrScheme; if(GetActivePwrScheme(&uActivePwrScheme)) fResult = SetActivePwrScheme(uActivePwrScheme, NULL, NULL); } } } return fResult; }
-- Thanks, Robert Tonsing

Power schemes bug?
Windows Vista
User login
Related topics
- DMX Xfire 1024 Sound Card - get a "file not found" error
- Dynamic disk mirroring and parity striping (RAID 1, 5) in Vi
- upgrade advisor program problems part 2 (new version)
- Uh oh....Gartner speculating re more delays for Vista...
- Problem with Realtek ALC 850
- XP / Vista boot errors (winloader.exe)
- Booting Windows Vista
- New Vista Build
- Best method to transfer files & settings
- Quicktime 7.1 no video
- Can't disable wireless network
- CompletePC backup cannot be restored in beta2, correct?
- Windows Vista Beta 2 Software Compatibility List
- Vista & Ghost
- installing photosmart printers as a 990c
- How do I get 5456
- Media Player 11 not responding
- I must make a video like this but for VISTA
- Driver for High point raid and vista
- How to tell which version you're running
- Laptop hardware for Vista
- Vista's NTFS Version # ??
- Vista beta download link?
- Some gui changes
- Using Vista primarily on a TV
- what happend with msconfig???
- Build 5472, Matrox G400 only works in 16 colors mode
- send to desktop, create shortcut??
- HP 3500n on Vista
- epson stylus CX5200
- win32 app?
- TrendMicro PC-cillin
- Epson PictureMate: Anyone running one?
- Directions for uninstalling Vista and reverting back to XP
- Compact Flash Disk - All work except SanDisk