<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AutoHotkey: определение текущего пути в окне Проводника]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=811</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=811&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AutoHotkey: определение текущего пути в окне Проводника».]]></description>
		<lastBuildDate>Wed, 09 Apr 2008 14:54:29 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AutoHotkey: определение текущего пути в окне Проводника]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=10367#p10367</link>
			<description><![CDATA[<p>Для большего удобства копирования пути в буфер вместо MsgBox можно вызвать специальное окно GUI:<br /></p><div class="codebox"><pre><code>F11::
  hWnd := WinExist(&quot;A&quot;) 
  WinGetClass wClass, ahk_id %hWnd% 
  If (wClass != &quot;ExploreWClass&quot; and wClass != &quot;CabinetWClass&quot;) 
     MsgBox Используйте только в окне Проводника! 
  Else
  {  
    ;MsgBox % GetWindowsExplorerPath(hWnd) 
    Res := GetWindowsExplorerPath(hWnd)
    Gui, +AlwaysOnTop
    Gui, Add, Edit, vMainEdit W600
    GuiControl,, MainEdit, %Res%
    Gui, Show, AutoSize Center, Текущий путь
   }
Return

GuiClose:
Gui, Destroy
Return

;=================================================

GetWindowsExplorerPath(_hWnd) 
{ 
   local pid, hMem, pv, pidl, pidl?, explorerPath 

   If (A_OSType = &quot;WIN32_NT&quot;) 
   { 
      pid := DllCall(&quot;GetCurrentProcessId&quot;) 
      SendMessage 0x400 + 12   ; CWM_GETPATH = WM_USER + 12 
            , pid, 0, , ahk_id %_hWnd% 
      hMem := ErrorLevel 
      if (hMem != 0) 
      { 
         pv := DllCall(&quot;Shell32\SHLockShared&quot; 
            , &quot;UInt&quot;, hMem, &quot;UInt&quot;, pid) 
         if (pv != 0) 
         { 
            pidl := DllCall(&quot;Shell32\ILClone&quot;, &quot;UInt&quot;, pv) 
            DllCall(&quot;Shell32\SHUnlockShared&quot;, &quot;UInt&quot;, pv) 
         } 
         DllCall(&quot;Shell32\SHFreeShared&quot; 
            , &quot;UInt&quot;, hMem, &quot;UInt&quot;, pid) 
      } 
   } 
   VarSetCapacity(explorerPath, 512, 0) 
   DllCall(&quot;Shell32\SHGetPathFromIDList&quot; 
      , &quot;UInt&quot;, pidl, &quot;Str&quot;, explorerPath) 
   Return explorerPath 
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Steve Key)]]></author>
			<pubDate>Wed, 09 Apr 2008 14:54:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=10367#p10367</guid>
		</item>
		<item>
			<title><![CDATA[AutoHotkey: определение текущего пути в окне Проводника]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=5835#p5835</link>
			<description><![CDATA[<p>Скрипт демонстрирует возможность определения текущего пути в окне Проводника. По нажатию F11 скрипт выводит окно сообщения, в котором указан путь к папке, откытой в текущем окне Проводника. Работает в WinХР, но не работает в Win2000.<br /></p><div class="codebox"><pre><code>F11::
  hWnd := WinExist(&quot;A&quot;) 
  WinGetClass wClass, ahk_id %hWnd% 
  If (wClass != &quot;ExploreWClass&quot; and wClass != &quot;CabinetWClass&quot;) 
     MsgBox Используйте только в окне Проводника! 
  Else 
     MsgBox % GetWindowsExplorerPath(hWnd) 
Return

;=================================================

GetWindowsExplorerPath(_hWnd) 
{ 
   local pid, hMem, pv, pidl, pidl?, explorerPath 

   If (A_OSType = &quot;WIN32_NT&quot;) 
   { 
      pid := DllCall(&quot;GetCurrentProcessId&quot;) 
      SendMessage 0x400 + 12   ; CWM_GETPATH = WM_USER + 12 
            , pid, 0, , ahk_id %_hWnd% 
      hMem := ErrorLevel 
      if (hMem != 0) 
      { 
         pv := DllCall(&quot;Shell32\SHLockShared&quot; 
            , &quot;UInt&quot;, hMem, &quot;UInt&quot;, pid) 
         if (pv != 0) 
         { 
            pidl := DllCall(&quot;Shell32\ILClone&quot;, &quot;UInt&quot;, pv) 
            DllCall(&quot;Shell32\SHUnlockShared&quot;, &quot;UInt&quot;, pv) 
         } 
         DllCall(&quot;Shell32\SHFreeShared&quot; 
            , &quot;UInt&quot;, hMem, &quot;UInt&quot;, pid) 
      } 
   } 
   VarSetCapacity(explorerPath, 512, 0) 
   DllCall(&quot;Shell32\SHGetPathFromIDList&quot; 
      , &quot;UInt&quot;, pidl, &quot;Str&quot;, explorerPath) 
   Return explorerPath 
}</code></pre></div><p>Скрипт опубликовал <strong>YMP</strong>.</p>]]></description>
			<author><![CDATA[null@example.com (The gray Cardinal)]]></author>
			<pubDate>Sat, 03 Nov 2007 09:23:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=5835#p5835</guid>
		</item>
	</channel>
</rss>
