<?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=14316&amp;type=atom" />
	<updated>2018-11-13T18:07:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14316</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129762#p129762" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> а вот сейчас - все нормально вроде работает.<br />Спасибо вам большое.</p>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T18:07:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129762#p129762</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129761#p129761" />
			<content type="html"><![CDATA[<p>Тогда так попробуйте:<br /></p><div class="codebox"><pre><code>#Persistent
prID := -1 
DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;) 

MouseGet:
   MouseGetPos,,, hWnd, classNN
   WinGetClass, winClass, ahk_id %hWnd%
   Loop 1  {
      _prID := prID, prID := -1
      if winClass not in Shell_TrayWnd,UltraMonDeskTaskBar
         break
      if (winClass = &quot;Shell_TrayWnd&quot; &amp;&amp; classNN != &quot;MSTaskListWClass1&quot;) || (winClass = &quot;UltraMonDeskTaskBar&quot; &amp;&amp; classNN != &quot;ToolbarWindow321&quot;)
         break
      
      prID := _prID
      if ((ID := AccIDUnderMouse()) &amp;&amp; ID != prID &amp;&amp; (prID := ID))
         Send {LButton}
   }  
   SetTimer, MouseGet, -100
   Return

AccIDUnderMouse()   { 
   If DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;
      , &quot;Int64&quot;, 0*DllCall(&quot;GetCursorPos&quot;,&quot;Int64*&quot;,pt)+pt, &quot;Ptr*&quot;, pacc
      , &quot;Ptr&quot;, VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&amp;varChild) = 0 
   Return NumGet(varChild,8,&quot;UInt&quot;) 
}</code></pre></div><p>Я не совсем понял, зачем в изначальном скрипте для активации стоит<br /></p><div class="codebox"><pre><code>        WinActivate % &quot;ahk_id&quot; hShellTray
        SendInput ^{LButton}{LControl Up}</code></pre></div><p>Вроде, простого клика достаточно. Но если что-то будет не так, попробуйте заменить <em>Send {LButton}</em> на <em>Send ^{LButton}</em>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-13T17:53:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129761#p129761</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129760#p129760" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> да действительно - с двумя l - Shell_TrayWnd <br />Остальные названия - без ошибок.<br />Только что перепроверил.</p>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T17:49:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129760#p129760</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129758#p129758" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>OlegSmirnov пишет:</cite><blockquote><p>На главной панели задач - название ahk_class Shel_TrayWnd</p></blockquote></div><p>Уверены, что именно так, не Shel<strong>l</strong>_TrayWnd (с двойной l)?<br />Остальные названия точно без ошибок написаны?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-13T17:18:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129758#p129758</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129751#p129751" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> на второстепенных мониторах - везде &quot;ClassNN:ToolbarWindow321&quot;<br />На основном мониторе - везде &quot;ClassNN:MSTaskListWClass1&quot;<br />(На панели задач второстепенных мониторов - трей отсутствует)</p>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T15:52:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129751#p129751</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129745#p129745" />
			<content type="html"><![CDATA[<p>Попробуйте на второстепенных мониторах навести курсор на панель задач, сначала на середину, потом на область иконок (трей).<br />Какой ClassNN выдаёт ActiveWindow Info в этих двух случаях?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-13T14:52:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129745#p129745</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129741#p129741" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, не срабатывает скрипт.<br />На панели задач главного монитора - работает нормально. <br />Но если наводить курсор на ярлыки - на других панелей задач - то скрипт не щелкает по ним.</p><p>Насчет ahk панелей задач:<br />На главной панели задач - название ahk_class Shel_TrayWnd<br />На второстепенных панелях задач - название ahk_class UltraMonDeskTaskBar</p>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T14:48:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129741#p129741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129738#p129738" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>OlegSmirnov пишет:</cite><blockquote><p>А щелчок на панели задач второстепенного монитора - выдает название: &quot;ClassNN:ToolbarWindow321&quot;</p></blockquote></div><p>Если наведёте курсор на область трея в панели задач главного монитора — думаю, выдаст то же самое. Здесь нас интересует не ClassNN, а класс окна (ahk_class).<br />Попробуйте так:<br /></p><div class="codebox"><pre><code>#Persistent
prID := -1 
DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;) 

MouseGet:
    MouseGetPos,,, hWnd
    WinGetClass, winClass, ahk_id %hWnd%
    If (winClass != &quot;Shell_TrayWnd&quot;)
        prID := -1
    Else If ((ID := AccIDUnderMouse()) &amp;&amp; ID != prID &amp;&amp; (prID := ID))
    { 
        WinActivate % &quot;ahk_id&quot; hShellTray
        SendInput ^{LButton}{LControl Up}
    }  
    SetTimer, MouseGet, -10
    Return
    
AccIDUnderMouse()   { 
    If DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;
        , &quot;Int64&quot;, 0*DllCall(&quot;GetCursorPos&quot;,&quot;Int64*&quot;,pt)+pt, &quot;Ptr*&quot;, pacc
        , &quot;Ptr&quot;, VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&amp;varChild) = 0 
    Return NumGet(varChild,8,&quot;UInt&quot;) 
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-13T14:04:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129738#p129738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129736#p129736" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, нет - это несколько рабочих столов.<br />На каждом есть своя панель задач.<br />ПринтСкрин выдает фот такое изображение:</p><p><a href="https://radikal.ru"><span class="postimg"><img src="https://a.radikal.ru/a41/1811/28/81996a0bc43f.jpg" alt="https://a.radikal.ru/a41/1811/28/81996a0bc43f.jpg" /></span></a></p><p>Щелчок ActiveWindow Info - на панели задач главного монитора - выдает название элемента: &quot;ClassNN:MSTaskListWClass1&quot;<br />А щелчок на панели задач второстепенного монитора - выдает название: &quot;ClassNN:ToolbarWindow321&quot;</p>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T13:53:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129736#p129736</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129734#p129734" />
			<content type="html"><![CDATA[<p>А мониторы настроены, как один виртуальный рабочий стол, или это независимые рабочие столы?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-13T13:39:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129734#p129734</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129733#p129733" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> показывает цифру &quot;1&quot;</p>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T13:36:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129733#p129733</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129729#p129729" />
			<content type="html"><![CDATA[<p>Что у вас такой код показывает, когда включено больше одного монитора?<br /></p><div class="codebox"><pre><code>WinGet, List, List, ahk_class Shell_TrayWnd
MsgBox, % List</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-11-13T13:11:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129729#p129729</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:Активация окна при наведении курсора на ярлык. Несколько мониторов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=129726#p129726" />
			<content type="html"><![CDATA[<p>Приветствую всех.<br />Вот у меня есть скрипт - активации окон - по наведению курсора на их ярлыки в панели задач.<br />Все работает хорошо.</p><p>Но это касается только главного монитора.<br />На остальных мониторах - не действует подобное наведение курсора на ярлыки на панели задач.<br />Как изменить макрос, чтобы и на других мониторах - курсор так же воздействовал бы - на ярлыки панели задач.<br /></p><div class="codebox"><pre><code>

#Persistent
prID := -1
hShellTray := WinExist(&quot;ahk_class Shell_TrayWnd ahk_exe explorer.exe&quot;) 
ControlGet, hTaskbar, HWND,, MSTaskListWClass1, % &quot;ahk_id&quot; hShellTray
DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;) 

MouseGet:
    MouseGetPos, , , , hCtrl, 2 
    If (hCtrl != hTaskbar)
        prID := -1
    Else If ((ID := AccIDUnderMouse()) &amp;&amp; ID != prID &amp;&amp; (prID := ID))
    { 
        WinActivate % &quot;ahk_id&quot; hShellTray
        SendInput ^{LButton}{LControl Up}
    }  
    SetTimer, MouseGet, -10
    Return
    
AccIDUnderMouse()   { 
    If DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;
        , &quot;Int64&quot;, 0*DllCall(&quot;GetCursorPos&quot;,&quot;Int64*&quot;,pt)+pt, &quot;Ptr*&quot;, pacc
        , &quot;Ptr&quot;, VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&amp;varChild) = 0 
    Return NumGet(varChild,8,&quot;UInt&quot;) 
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[OlegSmirnov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39576</uri>
			</author>
			<updated>2018-11-13T12:02:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=129726#p129726</id>
		</entry>
</feed>
