找回密码
 加入
搜索
查看: 6090|回复: 13

VISTA 中如何实现自动唤醒sleep/Hibernate???

[复制链接]
发表于 2009-4-23 16:11:09 | 显示全部楼层 |阅读模式
VISTA 中如何实现自动唤醒sleep/Hibernate???如何设置鼠标在当前位置或某坐标每隔一段时间点击一次??高手????3Q
 楼主| 发表于 2009-4-23 17:32:40 | 显示全部楼层
求教高手了!!!!!
发表于 2009-4-23 19:57:28 | 显示全部楼层
sleep状态,程序全部在内存中,冻结运行。只是系统内核在正常运行/Hibernate 情况下,内存中所有数据会写入磁盘,并关闭计算机。
发表于 2009-4-23 20:37:16 | 显示全部楼层
TheSnow老大,我也想知道休眠与睡眠如何唤醒呢,请教了
 楼主| 发表于 2009-4-24 09:58:12 | 显示全部楼层
高手     速度来啊
 楼主| 发表于 2009-4-24 10:24:15 | 显示全部楼层
鼠标动作自己已学习完成了,只求助如何吹唤醒sleep/Hibernate????
发表于 2009-4-24 16:20:10 | 显示全部楼层
这个应该是硬件级的问题,软件应该不能解决,不知道用有网络唤醒功能的网卡行不行!
 楼主| 发表于 2009-4-25 22:41:49 | 显示全部楼层
利用shutdown(32)可以进sleep,shutdown(64)可以进hibernate,就是不知道什么命令可以唤醒的.,有高手的请指示一下...
发表于 2009-4-25 23:26:43 | 显示全部楼层
我的意见同3楼和7楼。
程序都被强制暂停运行了,还有什么办法可以执行唤醒动作呢?就像程序都退出了,你还想让它执行某函数?
发表于 2009-4-26 13:05:59 | 显示全部楼层
sleep状态,程序全部在内存中,冻结运行。只是系统内核在正常运行/Hibernate 情况下,内存中所有数据会写入磁盘,并关闭计算机。
thesnow 发表于 2009-4-23 19:57

没有错sleep状态下任何程序都无法执行,MS自家的也是一样,这种状态完全靠硬件唤醒。
hibernate状态是把内存中的数据写到硬盘再执行关机操作,下次开机时恢复。
 楼主| 发表于 2009-4-28 11:52:52 | 显示全部楼层
没有错sleep状态下任何程序都无法执行,MS自家的也是一样,这种状态完全靠硬件唤醒。
hibernate状态是把内存中的数据写到硬盘再执行关机操作,下次开机时恢复。
78391493 发表于 2009-4-26 13:05

绝对可以唤醒的,只是没找到方法,比如Task Scheduler/Pwrtest 等都可以唤醒机器的,Task Sheduler 是机器自带的,Pwrtest 是一个软体,就是不知道用什么命令来实现这些。
发表于 2009-5-17 19:45:49 | 显示全部楼层
我也好想知道怎么唤醒机器.请高手指点啊
发表于 2009-9-29 13:45:52 | 显示全部楼层
Here you are.


#include <date.au3>

;===============================================================================
;
; Description:      Sets a wakeup time to wake it up if the system / computer is hibernating or standby
; Parameter(s):     $Hour     - Hour Values    : 0-23
;                    $Minute - Minutes Values: 0-59
;                    $Day    - Days Values    : 1-31    (optional)
;                   $Month     - Month Values    : 1-12     (optional)
;                   $Year     - Year Values    : > 0     (optional)
;
; Requirement(s):   DllCall
; Return Value(s):  On Success - 1
;                   On Failure - 0 sets @ERROR = 1 and @EXTENDED (Windows API error code)
;
; Error code(s):     http://msdn.microsoft.com/library/default....error_codes.asp
;
; Author(s):        Bastel123 aka Sebastian
; Note(s):          -
;
;===============================================================================
func SetWakeUpTime($Hour,$Minute,$Day=@mday,$Month=@mon,$Year=@YEAR)

$SYSTEMTIME = DllStructCreate("ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort")
$lpSYSTEMTIME = DllStructGetPtr($SYSTEMTIME)
$LOCALFILETIME=DllStructCreate("dword;dword")
$lpLOCALFILETIME = DllStructGetPtr($LOCALFILETIME)
$DueTime=DllStructCreate("dword;dword")
$lpDueTime=DllStructGetPtr($DueTime)

DllStructSetData($SYSTEMTIME, 1, $Year)
DllStructSetData($SYSTEMTIME, 2, $Month)
DllStructSetData($SYSTEMTIME, 3, _DateToDayOfWeek($Year,$Month,$Day)-1)
DllStructSetData($SYSTEMTIME, 4, $Day)
DllStructSetData($SYSTEMTIME, 5, $Hour)
DllStructSetData($SYSTEMTIME, 6, $Minute)
DllStructSetData($SYSTEMTIME, 7, 0)
DllStructSetData($SYSTEMTIME, 8, 0)

$result = DllCall("kernel32.dll", "long", "SystemTimeToFileTime", "ptr", $lpSystemTime, "ptr", $lpLocalFileTime)
If $result[0] = 0 Then
    Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    SetExtended($lastError[0])
    SetError(1)
    Return 0
EndIf
$result = DllCall("kernel32.dll", "long", "LocalFileTimeToFileTime", "ptr", $lpLocalFileTime, "ptr", $lpLocalFileTime)
If $result[0] = 0 Then
    Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    SetExtended($lastError[0])
    SetError(1)
    Return 0
EndIf
$result = DllCall("kernel32.dll", "long", "CreateWaitableTimer", "long", 0, "long", True, "str", "")
If $result[0] = 0 Then
    Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    SetExtended($lastError[0])
    SetError(1)
    Return 0
EndIf
DllCall("kernel32.dll", "none", "CancelWaitableTimer", "long",$result[0])

DllStructSetData($DueTime, 1, DllStructGetData($LocalFILETIME, 1))
DllStructSetData($DueTime, 2, DllStructGetData($LocalFILETIME, 2))

$result = DllCall("kernel32.dll", "long", "SetWaitableTimer", "long",$result[0], "ptr", $lpDueTime, "long", 1000, "long", 0, "long", 0, "long", true)
If $result[0] = 0 Then
    Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    SetExtended($lastError[0])
    SetError(1)
    Return 0
EndIf
return 1
EndFunc



;===============================================================================
;
; Description:      Set the computer in Hibernate or Standby Status
; Parameter(s):     $Mode     - Suspend mode    : True=Hibernate, False=Suspend
;                    $Force  - Force-Mode    : True=the system suspends operation immediately
;                                              False=FALSE, the system broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation   
;
; Requirement(s):   DllCall
;
; Author(s):        Bastel123 aka Sebastian
; Note(s):          If the system does not support hibernate use the standby mode          -
;
;===============================================================================
Func SetSuspend($mode=False,$force=true)
    $result = DllCall("PowrProf.dll", "long", "SetSuspendState", "long",$mode, "long",$force, "long", false)
EndFunc







SetWakeUpTime(@HOUR,@min+6); wakeup the system in 6 minutes from now

SetSuspend(); go to hibernate mode
发表于 2010-1-21 17:03:42 | 显示全部楼层
楼上的很强
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 13:44 , Processed in 0.078047 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表