<?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="http://forum.script-coding.com/extern.php?action=feed&amp;tid=8389&amp;type=atom" />
	<updated>2013-06-23T16:39:21Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=8389</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73244#p73244" />
			<content type="html"><![CDATA[<p>Malcev, спасибо. Программа tv_out написанная на AutoHotKey, что нужно! </p><p>Кстати, вот EnableDisplayDevice от некого superfraggle, что и была использована в программе tv_out. Функция позволяет управлять вкл\выкл мониторами, причём как я понял не сохраняя настроек в системе (на ваше усмотрение).<br /></p><div class="codebox"><pre><code>
;-----------------------------------
;--- by superfraggle
;--- http://www.autohotkey.com/board/topic/20084-secondary-monitor/?p=180370
;
; Enables, disables or toggles a display device. 
; 
; DeviceName:   The name of the device, e.g. \\.\DISPLAY1 
;               Alternatively, it can be the index of the device, which might 
;               not be the same as the number shown in Display Settings. 
; Action:       The action to take. 
;                    0   Disable (false is synonymous with 0) 
;                    1   Enable (true is synonymous with 1) 
;                   -1   Toggle 
; NoReset:      If true, settings will be saved to the registry, but not applied. 
; 
; The following can be used to apply settings saved in the registry: 
;   DllCall(&quot;ChangeDisplaySettings&quot;, &quot;uint&quot;, 0, &quot;uint&quot;, 1) 
; 
; Return values: 
;    DISP_CHANGE_SUCCESSFUL       0 
;    DISP_CHANGE_RESTART          1 
;    DISP_CHANGE_FAILED          -1 
;    DISP_CHANGE_BADMODE         -2 
;    DISP_CHANGE_NOTUPDATED      -3 
;    DISP_CHANGE_BADFLAGS        -4 
;    DISP_CHANGE_BADPARAM        -5 
; 

EnableDisplayDevice(DeviceName, Action=1, NoReset=false) 
{ 
    if (Action = -1) || (DeviceName+0 != &quot;&quot;) 
    { 
        VarSetCapacity(DisplayDevice, 424), NumPut(424, DisplayDevice, 0) 
        VarSetCapacity(ThisDeviceName, 32, 0) 
        Index = 0 
        Loop { 
            if !DllCall(&quot;EnumDisplayDevices&quot;, &quot;UInt&quot;, 0, &quot;UInt&quot;, A_Index-1, &quot;UInt&quot;, &amp;DisplayDevice, &quot;UInt&quot;, 0) 
                return -5 
            ThisDeviceState := NumGet(DisplayDevice, 164) 
            Index += 1 
            DllCall(&quot;lstrcpynA&quot;, &quot;Str&quot;, ThisDeviceName, &quot;UInt&quot;, &amp;DisplayDevice+4, &quot;int&quot;, 32) 
            if (DeviceName = Index || DeviceName = ThisDeviceName) 
            { 
                if Action = -1 
                    Action := !(ThisDeviceState &amp; 1) 
                DeviceName := ThisDeviceName 
                break 
            } 
        } 
    } 
    VarSetCapacity(devmode, 156, 0), NumPut(156, devmode, 36, &quot;UShort&quot;) 
    if (Action){ 
        NumPut(0x000020, devmode, 40) ; Enable by setting position = {0,0} 
        VarSetCapacity(Point,8,0) 
        Numput(A_ScreenWidth + 1,Point) 
        Numput(&amp;point,devmode,44) 
    } 
    else 
        NumPut(0x180020, devmode, 40) ; Disable by setting size = {0,0} 
    err := DllCall(&quot;ChangeDisplaySettingsEx&quot;, &quot;str&quot;, DeviceName, &quot;uint&quot;, &amp;devmode, &quot;uint&quot;, 0, &quot;uint&quot;, 0x10000001, &quot;uint&quot;, 0) 
    if !err &amp;&amp; !NoReset 
        err := DllCall(&quot;ChangeDisplaySettings&quot;, &quot;uint&quot;, 0, &quot;uint&quot;, 1) 
    return err, ErrorLevel:=Action 
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[AirKite]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30277</uri>
			</author>
			<updated>2013-06-23T16:39:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73244#p73244</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73168#p73168" />
			<content type="html"><![CDATA[<p>Можно так: (сам не проверял)<br /></p><div class="codebox"><pre><code>Run, RUNDLL32.EXE shell32.dll`,Control_RunDLL desk.cpl`,`,3
WinWait, Display Properties ahk_class #32770
Send, !d2!e!a ;2 stands for second monitor
Sleep, 500
Send, !e!a
WinWait, Monitor Settings ahk_class #32770
IfWinNotActive, Monitor Settings ahk_class #32770,,,,WinActivate, Monitor Settings ahk_class #32770
WinWaitActive, Monitor Settings ahk_class #32770
Send, !y
WinWaitActive, Display Properties ahk_class #32770
WinClose, Display Properties ahk_class #32770</code></pre></div><p>Либо воспользоваться программой:<br /><a href="http://nod5.dcmembers.com/tv_out.html">http://nod5.dcmembers.com/tv_out.html</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2013-06-21T01:19:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73168#p73168</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73167#p73167" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>При нажатии Win+P что-то в ХР происходит?</p></blockquote></div><p>Ничего не происходит...</p><div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>В программе-драйвере ATI есть возможность задать горячую клавишу на это действие?</p></blockquote></div><p>Ничего подобного я не видел. В папке с центром управления ATI, так же искал аналог DisplaySwitch.exe, ничего не нашлось. Поэтому и спрашиваю о реализации через AHK, посредством вызова какого либо системного запроса, аналогичный выполнению при (Раб.стол -&gt; Свойства -&gt; Параметры -&gt; Монитор 2 -&gt; Расширить рабочий стол на этот монитор).</p>]]></content>
			<author>
				<name><![CDATA[AirKite]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30277</uri>
			</author>
			<updated>2013-06-20T22:40:54Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73167#p73167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73163#p73163" />
			<content type="html"><![CDATA[<p>В программе-драйвере ATI есть возможность задать горячую клавишу на это действие?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2013-06-20T17:22:16Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73163#p73163</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73160#p73160" />
			<content type="html"><![CDATA[<p>При нажатии Win+P что-то в ХР происходит?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-06-20T16:58:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73160#p73160</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73159#p73159" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>В чём отличие от Run <em>DisplaySwitch.exe /extend ; Dual Wiev</em>?</p></blockquote></div><p>Скорее всего никаких. Что есть &quot;DisplaySwitch.exe&quot;? В оригинальной системе Windows XP SP3 такого файла нет. Откуда его брать?<br />p.s. Видео карта ATI Radeon 9250</p>]]></content>
			<author>
				<name><![CDATA[AirKite]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30277</uri>
			</author>
			<updated>2013-06-20T16:54:12Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73159#p73159</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73026#p73026" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>AirKite пишет:</cite><blockquote><p>именно активация\деактивация а не переключение главного монитора и режимов...</p></blockquote></div><div class="quotebox"><cite>AirKite пишет:</cite><blockquote><p>Я прикрепил скриншот, выделил чекбокс который регулирует то, что мне нужно. Активация\Деактивация а-ля &quot;расширить рабочий стол на этот монитор&quot;, монитор номер 2. По другому это можно объяснить как включение и выключение трансляции чего либо на второй монитор\телевизор.</p></blockquote></div><p>В чём отличие от Run <em>DisplaySwitch.exe /extend ; Dual Wiev</em>?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-06-18T04:39:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73026#p73026</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72998#p72998" />
			<content type="html"><![CDATA[<p>Я прикрепил скриншот, выделил чекбокс который регулирует то, что мне нужно. Активация\Деактивация а-ля &quot;расширить рабочий стол на этот монитор&quot;, монитор номер 2. По другому это можно объяснить как включение и выключение трансляции чего либо на второй монитор\телевизор. </p><p>Пользуюсь вторым экраном, когда мне это нужно. Хотелось бы задать горячею клавишу на выключение второго экрана, дабы работать не всегда приятно, когда курсор заходит за границы. Использовать Clone не вариант.</p>]]></content>
			<author>
				<name><![CDATA[AirKite]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30277</uri>
			</author>
			<updated>2013-06-17T12:46:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72998#p72998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72953#p72953" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Mikki пишет:</cite><blockquote><p>Что вы подразумеваете под термином &quot;активация\деактивация&quot; ?</p></blockquote></div><p>Угу. Интересный вопрос...</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-06-13T22:50:54Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72953#p72953</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72952#p72952" />
			<content type="html"><![CDATA[<p>Что вы подразумеваете под термином &quot;активация\деактивация&quot; ? Опишите порядок действий который вы бы хотели получить, и вам самому станет понятнее.</p>]]></content>
			<author>
				<name><![CDATA[Mikki]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=5905</uri>
			</author>
			<updated>2013-06-13T22:45:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72952#p72952</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72950#p72950" />
			<content type="html"><![CDATA[<p>Требуется для Windows XP и именно активация\деактивация а не переключение главного монитора и режимов...</p>]]></content>
			<author>
				<name><![CDATA[AirKite]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30277</uri>
			</author>
			<updated>2013-06-13T19:19:55Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72950#p72950</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72932#p72932" />
			<content type="html"><![CDATA[<p>На 7 так проще:<br /></p><div class="codebox"><pre><code>
Run DisplaySwitch.exe /internal ; первый монитор
Run DisplaySwitch.exe /external ; второй монитор
Run DisplaySwitch.exe /extend ; Dual Wiev
Run DisplaySwitch.exe /clone ; Clone
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-06-13T04:56:31Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72932#p72932</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Активация и деактивация второго монитора (нужна реализация).]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=72929#p72929" />
			<content type="html"><![CDATA[<p>Здравствуйте! Кто может подсказать, метод для включения\выключения второго экрана.<br /><span class="postimg"><img src="http://f3.s.qip.ru/13ASQaVyu.jpg" alt="http://f3.s.qip.ru/13ASQaVyu.jpg" /></span><br />Заранее спасибо!</p>]]></content>
			<author>
				<name><![CDATA[AirKite]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30277</uri>
			</author>
			<updated>2013-06-12T18:59:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=72929#p72929</id>
		</entry>
</feed>
