怎么样通过程序开启和关闭 电源选项属性中的"启用休眠"复选框???

解决方案 »

  1.   

    偶找到这些,你看看禁止
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
    "Heuristics"=hex:05,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,3f,42,0f,00[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power]
    "Heuristics"=hex:05,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,3f,42,0f,00[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Session Manager\Power]
    "Heuristics"=hex:05,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,3f,42,0f,00 启用
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
    "Heuristics"=hex:05,00,00,00,00,01,01,00,97,0B,00,00,16,00,00,00,8C,00,00,00[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power]
    "Heuristics"=hex:05,00,00,00,00,01,01,00,97,0B,00,00,16,00,00,00,8C,00,00,00[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Session Manager\Power]
    "Heuristics"=hex:05,00,00,00,00,01,01,00,97,0B,00,00,16,00,00,00,8C,00,00,00
      

  2.   

    启用:
    HKEY hk; 
    BYTE szBuf[]={5,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,63,66,15,0}; 
    LONG lRet;
     
    lRet = RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", &hk);
    if (lRet == ERROR_SUCCESS) 
    {
      RegSetValueEx(hk,"Heuristics", 0,REG_BINARY,(LPBYTE) szBuf,sizeof(szBuf));
      RegCloseKey(hk);
    }禁用:
    HKEY hk; 
    BYTE szBuf[]={5,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,63,66,15,0}; 
    LONG lRet;
     
    lRet = RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", &hk);
    if (lRet == ERROR_SUCCESS) 
    {
      RegSetValueEx(hk,"Heuristics", 0,REG_BINARY,(LPBYTE) szBuf,sizeof(szBuf));
      RegCloseKey(hk);
    }要重新启动电脑才会生效!
      

  3.   

    To  jjkk168 : 辛苦你了...To  supergreenbean : 试试看.To  wxfy1977 :要重新启动电脑???
      

  4.   

    应当关键不在于编注册表,而在于怎么分配一段与内存大小相同的空间,分配在什么位置,以什么格式分配,相信Windows应当有未公开的API
      

  5.   

    找到并结束Explorer.exe进程,然后在加载Explorer.exe进程!就不用重新启动了!
      

  6.   

    因为 Windows 本身设置是不要做其他什么动作的Windows是怎么样做的呢?呵呵 大家继续研究下巴
      

  7.   

    我上网找了下 Windows Server 2003 中使用 Powercfg.exe可以完成这个要求
    /hibernate, /h
    使用此参数打开或关闭休眠功能。所有支持休眠的计算机都不支持休眠超时。你可以用shell调用这个xp中有wmi估计也可以完成命令行下关闭休眠 但是具体参数还没有找到希望对你有启发
      

  8.   

    更正一下我在xp系统试了下也有这个命令命令格式是这样的powercfg /h off这样就可以了2000不知道,98估计是没有这个命令 200分给我一半就行阿我不黑哈哈
      

  9.   

    感谢:aspower_(我知道楼下就欣赏偶的分)分都给你了好不?但是还是给别人一点巴你给150
      

  10.   

    Win2000不重新启动启用休眠是怎么样做到的?