<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Переход на уровень вверх по double click]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17131&amp;type=atom" />
	<updated>2022-05-20T02:45:00Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17131</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153288#p153288" />
			<content type="html"><![CDATA[<p>Сейчас только проверил, по мне этот вариант идеальный! Ни одного ложного срабатывания. 100% отработал как надо. Большое вам спасибо уважаемый <strong>teadrinker</strong> за такой замечательный скрипт. Скрипту точно место в коллекции.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-20T02:45:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153288#p153288</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153286#p153286" />
			<content type="html"><![CDATA[<p>Вот так должно быть надёжнее:<br /></p><div class="codebox"><pre><code>#If !res &amp;&amp; hWnd := WinActive(&quot;ahk_class CabinetWClass&quot;)
~LButton::
   if !res := IsEmptySpaceUnderCusor()
      Return
   KeyWait, LButton
   KeyWait, LButton, D T.4
   (!ErrorLevel &amp;&amp; NavigateToParentDir(hWnd))
   res := &quot;&quot;
   Return
#If

IsEmptySpaceUnderCusor() {
   Return AccObjectFromPoint().accRole(0) = (ROLE_SYSTEM_LIST := 0x21)
}

AccObjectFromPoint(ByRef childId = &quot;&quot;, x = &quot;&quot;, y = &quot;&quot;) {
   static VT_DISPATCH := 9, F_OWNVALUE := 1, h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
   AccObject := 0
   (x = &quot;&quot; || y = &quot;&quot;) ? DllCall(&quot;GetCursorPos&quot;, &quot;Int64P&quot;, pt) : pt := x &amp; 0xFFFFFFFF | y &lt;&lt; 32
   VarSetCapacity(varChild, 8 + A_PtrSize*2, 0)
   if DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;, &quot;Int64&quot;, pt, &quot;PtrP&quot;, pAcc, &quot;Ptr&quot;, &amp;varChild) = 0
      childId := NumGet(varChild, 8, &quot;UInt&quot;), AccObject := ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
   Return AccObject
}

NavigateToParentDir(hWnd) {
   static comType := (VT_ARRAY := 0x2000) | (VT_UI1 := 0x11)
   Shell := ComObjCreate(&quot;Shell.Application&quot;)
   for Window in Shell.Windows {
      if (hWnd = Window.hwnd) {
         Folder := Window.Document.Folder
         parentDirPath := Folder.ParentFolder.Self.Path
         break
      }
   }
   if parentDirPath {
      DllCall(&quot;shell32\SHParseDisplayName&quot;, &quot;WStr&quot;, parentDirPath, &quot;Ptr&quot;, 0, &quot;PtrP&quot;, PIDL, &quot;UInt&quot;, 0, &quot;Ptr&quot;, 0)
      ilSize := DllCall(&quot;shell32\ILGetSize&quot;, &quot;Ptr&quot;, PIDL, &quot;UInt&quot;)
      VarSetCapacity(SAFEARRAY, 16 + A_PtrSize*2, 0)
      NumPut(1     , SAFEARRAY)
      NumPut(1     , SAFEARRAY, 4)
      NumPut(PIDL  , SAFEARRAY, 8 + A_PtrSize)
      NumPut(ilSize, SAFEARRAY, 8 + A_PtrSize*2)
      try Window.Navigate2( ComObject(comType, &amp;SAFEARRAY), 0 )
      DllCall(&quot;shell32\ILFree&quot;, &quot;Ptr&quot;, PIDL)
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-05-19T11:56:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153286#p153286</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153284#p153284" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Понимаю, изначально считал что невозможно это сделать средствами ahk. Спасибо вам большое за реализацию скрипта.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-19T11:24:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153284#p153284</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153282#p153282" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ppss42 пишет:</cite><blockquote><p>теперь понял как выкладывать на i.imgur.</p></blockquote></div><p>Ваш сервис тоже даёт прямую ссылку, вот она:<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><p><span class="postimg"><img src="https://i.imgur.com/UyEQLHg.png" alt="https://i.imgur.com/UyEQLHg.png" /></span></p></div></div><div class="quotebox"><cite>ppss42 пишет:</cite><blockquote><p>изредка имеют место ложные срабатывания</p></blockquote></div><p>Скорее всего, с этим ничего не сделаешь, просто основная функция двойного клика успевает сработать раньше, чем код скрипта. Потестировал, у меня такое происходит очень редко, но случалось.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-05-19T10:50:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153282#p153282</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153279#p153279" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> теперь понял как выкладывать на i.imgur. По скрипту: ошибки не выдает, но изредка имеют место ложные срабатывания. При открытие папки, она открывается на сотые доли секунды, и тут же возвращается на уровень вверх (то есть на исходную директорию где был сделан клик)<br />P.s. Если бы не этот небольшой недочет, то наверное ему место в коллекции. Уж очень удобный в повседневном использовании.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-19T10:40:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153279#p153279</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153273#p153273" />
			<content type="html"><![CDATA[<p>Чтобы отобразить картинку, пользуйтесь сервисами, где можно получить прямую ссылку на изображение, эту ссылку оборачиваете тегами img. Я отредактировал ваш пост, можете посмотреть, как это сделано, нажав кнопку «Изменить».<br /></p><div class="quotebox"><cite>ppss42 пишет:</cite><blockquote><p>работает, но  к сожалению с ошибками</p></blockquote></div><p>Попробуйте так:<br /></p><div class="codebox"><pre><code>#If hWnd := WinActive(&quot;ahk_class CabinetWClass&quot;)
~LButton::
   if (A_PriorHotkey = A_ThisHotkey &amp;&amp; A_TimeSincePriorHotkey &lt; 400 &amp;&amp; IsEmptySpaceUnderCusor())
      NavigateToParentDir(hWnd)
   Return
#If

IsEmptySpaceUnderCusor() {
   Return AccObjectFromPoint().accRole(0) = (ROLE_SYSTEM_LIST := 0x21)
}

AccObjectFromPoint(ByRef childId = &quot;&quot;, x = &quot;&quot;, y = &quot;&quot;) {
   static VT_DISPATCH := 9, F_OWNVALUE := 1, h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
   AccObject := 0
   (x = &quot;&quot; || y = &quot;&quot;) ? DllCall(&quot;GetCursorPos&quot;, &quot;Int64P&quot;, pt) : pt := x &amp; 0xFFFFFFFF | y &lt;&lt; 32
   VarSetCapacity(varChild, 8 + A_PtrSize*2, 0)
   if DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;, &quot;Int64&quot;, pt, &quot;PtrP&quot;, pAcc, &quot;Ptr&quot;, &amp;varChild) = 0
      childId := NumGet(varChild, 8, &quot;UInt&quot;), AccObject := ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
   Return AccObject
}

NavigateToParentDir(hWnd) {
   static comType := (VT_ARRAY := 0x2000) | (VT_UI1 := 0x11)
   Shell := ComObjCreate(&quot;Shell.Application&quot;)
   for Window in Shell.Windows {
      if (hWnd = Window.hwnd) {
         Folder := Window.Document.Folder
         parentDirPath := Folder.ParentFolder.Self.Path
         break
      }
   }
   if parentDirPath {
      DllCall(&quot;shell32\SHParseDisplayName&quot;, &quot;WStr&quot;, parentDirPath, &quot;Ptr&quot;, 0, &quot;PtrP&quot;, PIDL, &quot;UInt&quot;, 0, &quot;Ptr&quot;, 0)
      ilSize := DllCall(&quot;shell32\ILGetSize&quot;, &quot;Ptr&quot;, PIDL, &quot;UInt&quot;)
      VarSetCapacity(SAFEARRAY, 16 + A_PtrSize*2, 0)
      NumPut(1     , SAFEARRAY)
      NumPut(1     , SAFEARRAY, 4)
      NumPut(PIDL  , SAFEARRAY, 8 + A_PtrSize)
      NumPut(ilSize, SAFEARRAY, 8 + A_PtrSize*2)
      try Window.Navigate2( ComObject(comType, &amp;SAFEARRAY), 0 )
      DllCall(&quot;shell32\ILFree&quot;, &quot;Ptr&quot;, PIDL)
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-05-19T10:00:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153273#p153273</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153271#p153271" />
			<content type="html"><![CDATA[<p><span class="postimg"><img src="https://i.imgur.com/Kv9hY09.png" alt="https://i.imgur.com/Kv9hY09.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-19T06:00:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153271#p153271</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153270#p153270" />
			<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>2022-05-19T05:42:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153270#p153270</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153269#p153269" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Даже не думал что будет решение. Опробовал скрипт, работает, но&nbsp; к сожалению с ошибками. После открытия нескольких папок выходит ошибка на 11 строке, где нужно вернуть значение из функции. Появляется в момент double клика по папке.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-19T02:56:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153269#p153269</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153263#p153263" />
			<content type="html"><![CDATA[<p>Вижу, без поллитра не разберётесь. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br /></p><div class="codebox"><pre><code>#If hWnd := WinActive(&quot;ahk_class CabinetWClass&quot;)
~LButton::
   if (A_PriorHotkey = A_ThisHotkey &amp;&amp; A_TimeSincePriorHotkey &lt; 400 &amp;&amp; IsEmptySpaceUnderCusor())
      NavigateToParentDir(hWnd)
   Return
#If

IsEmptySpaceUnderCusor() {
   static ROLE_SYSTEM_WINDOW := 0x00000009
   AccObj := AccObjectFromPoint(childId)
   Return (childId ? AccObj : AccObj.accParent).accRole(0) = ROLE_SYSTEM_WINDOW
}

AccObjectFromPoint(ByRef childId = &quot;&quot;, x = &quot;&quot;, y = &quot;&quot;) {
   static VT_DISPATCH := 9, F_OWNVALUE := 1, h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
   AccObject := 0
   (x = &quot;&quot; || y = &quot;&quot;) ? DllCall(&quot;GetCursorPos&quot;, &quot;Int64P&quot;, pt) : pt := x &amp; 0xFFFFFFFF | y &lt;&lt; 32
   VarSetCapacity(varChild, 8 + A_PtrSize*2, 0)
   if DllCall(&quot;oleacc\AccessibleObjectFromPoint&quot;, &quot;Int64&quot;, pt, &quot;PtrP&quot;, pAcc, &quot;Ptr&quot;, &amp;varChild) = 0
      childId := NumGet(varChild, 8, &quot;UInt&quot;), AccObject := ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
   Return AccObject
}

NavigateToParentDir(hWnd) {
   static comType := (VT_ARRAY := 0x2000) | (VT_UI1 := 0x11)
   Shell := ComObjCreate(&quot;Shell.Application&quot;)
   for Window in Shell.Windows {
      if (hWnd = Window.hwnd) {
         Folder := Window.Document.Folder
         parentDirPath := Folder.ParentFolder.Self.Path
         break
      }
   }
   if parentDirPath {
      DllCall(&quot;shell32\SHParseDisplayName&quot;, &quot;WStr&quot;, parentDirPath, &quot;Ptr&quot;, 0, &quot;PtrP&quot;, PIDL, &quot;UInt&quot;, 0, &quot;Ptr&quot;, 0)
      ilSize := DllCall(&quot;shell32\ILGetSize&quot;, &quot;Ptr&quot;, PIDL, &quot;UInt&quot;)
      VarSetCapacity(SAFEARRAY, 16 + A_PtrSize*2, 0)
      NumPut(1     , SAFEARRAY)
      NumPut(1     , SAFEARRAY, 4)
      NumPut(PIDL  , SAFEARRAY, 8 + A_PtrSize)
      NumPut(ilSize, SAFEARRAY, 8 + A_PtrSize*2)
      try Window.Navigate2( ComObject(comType, &amp;SAFEARRAY), 0 )
      DllCall(&quot;shell32\ILFree&quot;, &quot;Ptr&quot;, PIDL)
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-05-18T16:47:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153263#p153263</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153262#p153262" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong> Я знаю про эту утилиту, пользовался какое то время (окна по типу вкладок, слишком много настроек). Но не зашла эта утилита, со временем вернулся на проводник Windows. Не хватает для полного счастья, только этой функции.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-18T16:40:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153262#p153262</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153261#p153261" />
			<content type="html"><![CDATA[<p>Для проводника есть QTTabBar там есть такая функция.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2022-05-18T16:34:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153261#p153261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153260#p153260" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong> Да нет, не обязательно ahk. Нужно для личных нужд. Пользовался разными файловыми менеджерами, и там привык к этому действию.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2022-05-18T16:32:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153260#p153260</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153259#p153259" />
			<content type="html"><![CDATA[<p>Нужно ahk именно?</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2022-05-18T16:27:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153259#p153259</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Переход на уровень вверх по double click]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=153258#p153258" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=10427">Библеотека такая</a>.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2022-05-18T16:21:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=153258#p153258</id>
		</entry>
</feed>
