<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Выход из спящего режима]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15018&amp;type=atom" />
	<updated>2019-10-13T18:34:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15018</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Выход из спящего режима]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136351#p136351" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>SleepTime := 60    ; время в сна секундах
SleepMode := true  ; true — гибернация, false — сон

hTimer := DllCall(&quot;CreateWaitableTimer&quot;, &quot;Ptr&quot;, 0, &quot;UInt&quot;, 0, &quot;Str&quot;, &quot;MyTimer&quot;, &quot;Ptr&quot;)
DllCall(&quot;SetWaitableTimer&quot;, &quot;Ptr&quot;, hTimer, &quot;Int64P&quot;, -SleepTime*10000000, &quot;UInt&quot;, 0, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, 0, &quot;UInt&quot;, 1)
if (A_LastError = 50) {; ERROR_NOT_SUPPORTED
	DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, hTimer)
	MsgBox, Этот компьютер не поддерживает пробуждение по таймеру!
	Return
}
DllCall(&quot;PowrProf\SetSuspendState&quot;, &quot;UInt&quot;, SleepMode, &quot;UInt&quot;, 0, &quot;UInt&quot;, 0)
DllCall(&quot;WaitForSingleObject&quot;, &quot;Ptr&quot;, hTimer, &quot;UInt&quot;, INFINITE := 0xFFFFFFFF)
DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, hTimer)
Return</code></pre></div><p>Если не нужно сразу же отправлять в сон, закомментируй строку </p><div class="codebox"><pre><code>DllCall(&quot;PowrProf\SetSuspendState&quot;, &quot;UInt&quot;, SleepMode, &quot;UInt&quot;, 0, &quot;UInt&quot;, 0)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-10-13T18:34:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136351#p136351</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Выход из спящего режима]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136350#p136350" />
			<content type="html"><![CDATA[<p>Вроде можно устанавливать таймер пробуждения. Сам не пробовал, просто в поисковике задал вопрос.</p><p><a href="https://viarum.ru/kak-posmotret-taymeryi-probuzhdeniya/">Как посмотреть все таймеры пробуждения в Windows 8.1 и 10</a><br /><a href="https://yandex.ru/turbo?text=https%3A%2F%2Fwindows10w.ru%2Fhelp%2Fsamovklyuchenie-ili-probuzhdenie-windows-10.html&amp;d=1">Самовключение или пробуждение Windows 10</a></p><p>Насколько я понимаю, во время сна все процессы замораживаются.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2019-10-13T18:21:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136350#p136350</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Выход из спящего режима]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136349#p136349" />
			<content type="html"><![CDATA[<p>Возможно ли как-то по таймеру (расписанию) с помощью скрипта выйти из спящего режима?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2019-10-13T17:57:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136349#p136349</id>
		</entry>
</feed>
