DWORD dError = -1;
CEDEVICE_POWER_STATE powerState;
int i = 0;
GetDevicePower(_T("{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\SDIO86861"),POWER_NAME, &powerState);
while(powerState != D4 && i<10)
{
DevicePowerNotify(_T("{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\SDIO86861"), D4, POWER_NAME);
dError = SetDevicePower((LPVOID)(TEXT("{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\SDIO86861")), POWER_NAME, D4);
GetDevicePower(_T("{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\SDIO86861"),POWER_NAME,&powerState);
Sleep(100);
i++;
}
{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\SDIO86861" :设备GUID,可以在注册表中获取
\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State\Suspend\