禁止/启用屏幕保护及系统热键等
作者:徐景周
1. 禁止/启用屏幕保护及电源管理
static uint dss_getlist[] = {spi_getlowpowertimeout, spi_getpowerofftimeout, spi_getscreensavetimeout};
static uint dss_setlist[] = {spi_setlowpowertimeout, spi_setpowerofftimeout, spi_setscreensavetimeout};
static const int dss_listcount = _countof(dss_getlist);
l 禁止屏幕保护及电源管理
{
m_pvalue = new int[dss_listcount];
for (int x=0;x<dss_listcount;x++)
{
// 禁止屏幕保护及电源管理
verify(systemparametersinfo (dss_setlist[x], 0, null, 0));
}
delete[] m_pvalue;
}
l 启用屏幕保护及电源管理
{
m_pvalue = new int[dss_listcount];
for (int x=0;x<dss_listcount;x++)
{