Автор: OnMyDSeeAtAll
Дата сообщения: 08.01.2012 13:52
Код: ComObjGet("winmgmts:").ExecQuery("select LastBootUpTime from "
. "Win32_OperatingSystem where Primary='true'")._NewEnum.Next(Key)
IniRead, LastBootUpTime
, % A_ScriptDir "\"SubStr(A_ScriptName, 1, -4)".ini"
, Set
, LastBootUpTime
If % LastBootUpTime!=SubStr(Key.LastBootUpTime, 1, -11)
{
IniWrite, % SubStr(Key.LastBootUpTime, 1, -11)
, % A_ScriptDir "\"SubStr(A_ScriptName, 1, -4)".ini"
, Set
, LastBootUpTime
IniWrite, % RunCount:=1
, % A_ScriptDir "\"SubStr(A_ScriptName, 1, -4)".ini"
, Set
, RunCount
}
IniRead, RunCount
, % A_ScriptDir "\"SubStr(A_ScriptName, 1, -4)".ini"
, Set
, RunCount
MsgBox, 262208, Info, % "Current run is: "RunCount, 1
OnMessage(1028, "WndProc")
OnExit, ExitScript
Esc::
Suspend
ExitApp
ExitScript:
IniWrite, % ++RunCount
, % A_ScriptDir "\"SubStr(A_ScriptName, 1, -4)".ini"
, Set
, RunCount
MsgBox, 262192, Info, % "Next run is: "RunCount, 1
ExitApp
WndProc(Params*)
{
If Params.2=519
{
Suspend
TrayTip,, % "Suspend is: "(A_IsSuspended ? "On":"Off")
Sleep, 1000
TrayTip
}
}