<?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=10981&amp;type=atom" />
	<updated>2015-09-27T16:47:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10981</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97719#p97719" />
			<content type="html"><![CDATA[<p>Слышал, можно как-то перехватить при помощи ahk скан коды с родной клавы на hid уровне. А можно ли наоборот, отправить команды со второй клавиатуры, эмулируя HID устройство?</p>]]></content>
			<author>
				<name><![CDATA[DJ_URAN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33371</uri>
			</author>
			<updated>2015-09-27T16:47:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97719#p97719</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97717#p97717" />
			<content type="html"><![CDATA[<p>Потому что это делают дрова и программа входящая в комплект.</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2015-09-27T13:09:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97717#p97717</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97716#p97716" />
			<content type="html"><![CDATA[<p>Почему статусбар родной виндовый появляется только при регулировке кнопками ноута?</p>]]></content>
			<author>
				<name><![CDATA[DJ_URAN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33371</uri>
			</author>
			<updated>2015-09-26T20:47:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97716#p97716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97715#p97715" />
			<content type="html"><![CDATA[<p>Последний скрипт выдает ошибку. Предыдущий опробовал с F1 и F2, яркость меняется. Бар выскакивает самопальный=)<br />Я когда говорил про статусбар, я имел в виду штатный бар от windows. При регулировке громкости он же появляется, и когда яркость регулирую родной ноутбучной клавой, тоже появляется статусбар с ползунком.<br />Их откуда выдрать?</p>]]></content>
			<author>
				<name><![CDATA[DJ_URAN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33371</uri>
			</author>
			<updated>2015-09-26T18:47:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97715#p97715</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97714#p97714" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>DJ_URAN пишет:</cite><blockquote><p>А так вообще ничего не происходит.<br />Я подумал, может, как-то можно использовать этот документ: https://msdn.microsoft.com/en-us/library/windows/hardware/dn613956%28v=vs.85%29.aspx</p></blockquote></div><p>Используй &quot;F1&quot;, &quot;F2&quot;.</p>]]></content>
			<author>
				<name><![CDATA[Eduard]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28482</uri>
			</author>
			<updated>2015-09-26T18:31:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97714#p97714</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97712#p97712" />
			<content type="html"><![CDATA[<p><strong><span style="color: #ff0000">Бар™.</span></strong><br /></p><div class="codebox"><pre><code>#NoEnv
Br:= 3 ; 0-10

f1::
if Br &gt; 0
    Br--
ToolTip, % levelbar(Br)
SetBrightness(Br*10)
SetTimer, HideTool, -700
return

f2::
if br &lt;10
    Br++
ToolTip, % levelbar(Br)
SetBrightness(Br*10)
SetTimer, HideTool, -700
return

levelbar(ByRef v){
    Loop, % v
        a.=&quot;☻&quot;
    Loop, % 10 - v
        a.=&quot;☺&quot;
    return &quot;[&quot; a &quot;]&quot;
}

HideTool:
ToolTip
return

;~ c:= 0
;~ Loop, 11
;~ {
    ;~ SetBrightness((c++) * 10)
    ;~ Sleep 1000
;~ }
;~ ExitApp

SetBrightness(ByRef Level)
{
hLCD := DllCall(&quot;CreateFile&quot;
    , Str, &quot;\\.\LCD&quot;
    , UInt, 0x80000000 | 0x40000000  ; GENERIC_READ | GENERIC_WRITE
    , UInt, 0x1 | 0x2  ; FILE_SHARE_READ | FILE_SHARE_WRITE
    , UInt, 0
    , UInt, 0x3  ; OPEN_EXISTING
    , UInt, 0, UInt, 0)
if hLCD &lt;&gt; -1
{
    FILE_DEVICE_VIDEO := 0x00000023, METHOD_BUFFERED := 0, FILE_ANY_ACCESS := 0
    VarSetCapacity(DISPLAY_BRIGHTNESS, 3, 0)
        NumPut(0x03, DISPLAY_BRIGHTNESS, 0, &quot;UChar&quot;)    ; 0x01 = Set AC, 0x02 = Set DC, 0x03 = Set both
        NumPut(Level, DISPLAY_BRIGHTNESS, 1, &quot;UChar&quot;)        ; The AC brightness level
        NumPut(Level, DISPLAY_BRIGHTNESS, 2, &quot;UChar&quot;)        ; The DC brightness level
     DllCall(&quot;DeviceIoControl&quot;
        , UInt, hLCD
        , UInt, (FILE_DEVICE_VIDEO&lt;&lt;16 | 0x127&lt;&lt;2 | METHOD_BUFFERED&lt;&lt;14 | FILE_ANY_ACCESS) ; IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS
        , UInt, &amp;DISPLAY_BRIGHTNESS, UInt, 3
        , UInt, 0, UInt, 0
        , UIntP, dwBytesReturned  ; Unused.
        , UInt, 0)
    DllCall(&quot;CloseHandle&quot;, UInt, hLCD)
}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Eduard]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28482</uri>
			</author>
			<updated>2015-09-26T18:16:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97712#p97712</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97711#p97711" />
			<content type="html"><![CDATA[<p>А так вообще ничего не происходит.<br />Я подумал, может, как-то можно использовать этот документ: https://msdn.microsoft.com/en-us/library/windows/hardware/dn613956%28v=vs.85%29.aspx</p>]]></content>
			<author>
				<name><![CDATA[DJ_URAN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33371</uri>
			</author>
			<updated>2015-09-26T18:14:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97711#p97711</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97710#p97710" />
			<content type="html"><![CDATA[<p>Так?<br /></p><div class="codebox"><pre><code>#NoEnv
Br:= 3 ; 0-10

f1::
if Br &gt; 0
    Br--
ToolTip, % val:= Br*10 &quot;%&quot;
SetBrightness(val)
SetTimer, HideTool, -700
return

f2::
if br &lt;10
    Br++
ToolTip, % val:= Br*10 &quot;%&quot;
SetBrightness(val)
SetTimer, HideTool, -700
return

HideTool:
ToolTip
return

;~ c:= 0
;~ Loop, 11
;~ {
    ;~ SetBrightness((c++) * 10)
    ;~ Sleep 1000
;~ }
;~ ExitApp

SetBrightness(ByRef Level)
{
hLCD := DllCall(&quot;CreateFile&quot;
    , Str, &quot;\\.\LCD&quot;
    , UInt, 0x80000000 | 0x40000000  ; GENERIC_READ | GENERIC_WRITE
    , UInt, 0x1 | 0x2  ; FILE_SHARE_READ | FILE_SHARE_WRITE
    , UInt, 0
    , UInt, 0x3  ; OPEN_EXISTING
    , UInt, 0, UInt, 0)
if hLCD &lt;&gt; -1
{
    FILE_DEVICE_VIDEO := 0x00000023, METHOD_BUFFERED := 0, FILE_ANY_ACCESS := 0
    VarSetCapacity(DISPLAY_BRIGHTNESS, 3, 0)
        NumPut(0x03, DISPLAY_BRIGHTNESS, 0, &quot;UChar&quot;)    ; 0x01 = Set AC, 0x02 = Set DC, 0x03 = Set both
        NumPut(Level, DISPLAY_BRIGHTNESS, 1, &quot;UChar&quot;)        ; The AC brightness level
        NumPut(Level, DISPLAY_BRIGHTNESS, 2, &quot;UChar&quot;)        ; The DC brightness level
     DllCall(&quot;DeviceIoControl&quot;
        , UInt, hLCD
        , UInt, (FILE_DEVICE_VIDEO&lt;&lt;16 | 0x127&lt;&lt;2 | METHOD_BUFFERED&lt;&lt;14 | FILE_ANY_ACCESS) ; IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS
        , UInt, &amp;DISPLAY_BRIGHTNESS, UInt, 3
        , UInt, 0, UInt, 0
        , UIntP, dwBytesReturned  ; Unused.
        , UInt, 0)
    DllCall(&quot;CloseHandle&quot;, UInt, hLCD)
}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Eduard]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28482</uri>
			</author>
			<updated>2015-09-26T17:51:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97710#p97710</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97708#p97708" />
			<content type="html"><![CDATA[<p>Скрипт опробовал. Происходит ступенчатая регулировка яркости от минимума к максимуму. Индикатора нет. Ползункового.</p>]]></content>
			<author>
				<name><![CDATA[DJ_URAN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33371</uri>
			</author>
			<updated>2015-09-26T14:58:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97708#p97708</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97707#p97707" />
			<content type="html"><![CDATA[<p>Протестируй<br /></p><div class="codebox"><pre><code>
#NoEnv

c:= 0
Loop, 11
{
    SetBrightness((c++) * 10)
    Sleep 1000
}
ExitApp

SetBrightness(ByRef Level)
{
hLCD := DllCall(&quot;CreateFile&quot;
    , Str, &quot;\\.\LCD&quot;
    , UInt, 0x80000000 | 0x40000000  ; GENERIC_READ | GENERIC_WRITE
    , UInt, 0x1 | 0x2  ; FILE_SHARE_READ | FILE_SHARE_WRITE
    , UInt, 0
    , UInt, 0x3  ; OPEN_EXISTING
    , UInt, 0, UInt, 0)
if hLCD &lt;&gt; -1
{
    FILE_DEVICE_VIDEO := 0x00000023, METHOD_BUFFERED := 0, FILE_ANY_ACCESS := 0
    VarSetCapacity(DISPLAY_BRIGHTNESS, 3, 0)
        NumPut(0x03, DISPLAY_BRIGHTNESS, 0, &quot;UChar&quot;)    ; 0x01 = Set AC, 0x02 = Set DC, 0x03 = Set both
        NumPut(Level, DISPLAY_BRIGHTNESS, 1, &quot;UChar&quot;)        ; The AC brightness level
        NumPut(Level, DISPLAY_BRIGHTNESS, 2, &quot;UChar&quot;)        ; The DC brightness level
     DllCall(&quot;DeviceIoControl&quot;
        , UInt, hLCD
        , UInt, (FILE_DEVICE_VIDEO&lt;&lt;16 | 0x127&lt;&lt;2 | METHOD_BUFFERED&lt;&lt;14 | FILE_ANY_ACCESS) ; IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS
        , UInt, &amp;DISPLAY_BRIGHTNESS, UInt, 3
        , UInt, 0, UInt, 0
        , UIntP, dwBytesReturned  ; Unused.
        , UInt, 0)
    DllCall(&quot;CloseHandle&quot;, UInt, hLCD)
}
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Eduard]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28482</uri>
			</author>
			<updated>2015-09-26T14:25:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97707#p97707</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Регулировка яркости экрана]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97705#p97705" />
			<content type="html"><![CDATA[<p>Други, помогайте!<br />Имеется ноутбук с подключенной клавиатурой (bluetooth) на windows 10.<br />При помощи Autohotkey и nircmd создал скрипт регулировки яркости, но при регулировке не отображается GUI windows (ghb регулировке громкости, например, он есть. Ползунок отображается только при регулировке с родной ноутбучной клавиатуры. Прочитал про Nircmd, там пишут, что ползунка отображаться не должно. <br />Можно ли как-нибудь управлять яркостью через DLL драйвера видеокарты? (У меня ATI)<br />Нашел только способ для Nvidia http://forum.script-coding.com/viewtopic.php?pid=32381#p32381<br />Есть ли подобное описалово для ATI?<br />Спасибо всем за помощь!</p>]]></content>
			<author>
				<name><![CDATA[DJ_URAN]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33371</uri>
			</author>
			<updated>2015-09-26T08:32:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97705#p97705</id>
		</entry>
</feed>
