<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Захват и структурирование заметок]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=5840</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=5840&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Захват и структурирование заметок».]]></description>
		<lastBuildDate>Sat, 01 Nov 2014 20:00:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Захват и структурирование заметок]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=87914#p87914</link>
			<description><![CDATA[<p>Так все равно ссылки не будут работать, это была версия для ANSI.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sat, 01 Nov 2014 20:00:21 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=87914#p87914</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Захват и структурирование заметок]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=87866#p87866</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p><span class="postimg"><img src="http://i010.radikal.ru/1105/1a/3d347bc2a7c6.png" alt="http://i010.radikal.ru/1105/1a/3d347bc2a7c6.png" /></span></p><div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Я помню, такая тема уже была. Её поместили в Коллекцию?</p></blockquote></div><p>Нет, она работала плохо! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p></blockquote></div><br /><p>Заменил знак ? на единицу(просто так, наверно можно было любую цифру или букву написать) и все заработало.</p>]]></description>
			<author><![CDATA[null@example.com (v63)]]></author>
			<pubDate>Fri, 31 Oct 2014 09:02:27 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=87866#p87866</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Захват и структурирование заметок]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=48733#p48733</link>
			<description><![CDATA[<p><span class="postimg"><img src="http://i010.radikal.ru/1105/1a/3d347bc2a7c6.png" alt="http://i010.radikal.ru/1105/1a/3d347bc2a7c6.png" /></span></p><div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Я помню, такая тема уже была. Её поместили в Коллекцию?</p></blockquote></div><p>Нет, она работала плохо! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 27 May 2011 18:45:15 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=48733#p48733</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Захват и структурирование заметок]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=48732#p48732</link>
			<description><![CDATA[<p>Я помню, такая тема уже была. Её поместили в Коллекцию?</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Fri, 27 May 2011 18:39:55 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=48732#p48732</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Захват и структурирование заметок]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=48718#p48718</link>
			<description><![CDATA[<p>Предназначен для быстрого занесения текстовок разного рода, вместе с заголовком и адресом окна-источника (IE, Opera, Firefox, Word, CHM-Справка и некоторые другие, кроме страниц, оформленных фреймами), в HTML-документ «QNotes», упорядочивающий их по вкладкам в зависимости от выбора.</p><p>Сочетание <em>Ctrl + N</em><br />— одно нажатие, — вывести окно скрипта с существующими разделами (вкладками) файла «QNotes» и добавить выделенный/скопированный или набранный в контроле <em>Edit</em> текст в один из нужных;<br />— двойное нажатие, — добавить текст напрямую (без вывода окна GUI) в таб, выбиравшийся в последний раз;<br />— тройное, — открыть файл заметок (с помощью IE, — ибо Opera и FF затрудняются с открытием chm-содержащих ссылок).</p><p>Имеется возможность быстрого поиска по всем вкладкам, — двойной клик в поисковом input-окне (файла «QNotes») осуществит сброс поиска, двойной клик в пределах окна документа подготовит input-окно к вводу с клавиатуры.</p><p>Добавить/убавить количество разделов можно в местах, обозначенных в скрипте такими манерами:<br /></p><div class="quotebox"><blockquote><p>/* ... */<br />&lt;!-- ... --&gt;<br />; ...</p></blockquote></div><div class="codebox"><pre><code>#NoEnv
#SingleInstance,Force
SendMode Input
SetBatchLines,-1

MyIco=%A_ScriptDir%\notes.ico
IfNotExist %MyIco%
{
  Gosub, CrtIco
  WriteFile(&quot;notes.ico&quot;,Ico)
  IconFile = %MyIco%
}
Else
  IconFile = %MyIco%

Menu, Tray, Icon, %IconFile%


^SC31::        ;Ctrl + N
   ++counter
   SetTimer, Choice, -400
   return

Choice:
if A_ThisHotkey = ^SC31        ;Ctrl + N
   {
   IfEqual, counter, 1, Gosub, QNotesGui
   IfEqual, counter, 2, Gosub, QNotesAddLast
   IfEqual, counter, 3, Gosub, QNotesRun
   }

   counter =
Return


QNotesInstall:
  IfNotExist, %A_ScriptDir%\QNotes.html
  {
    FileAppend,
    (LTrim
    &lt;HTML&gt;`n&lt;HEAD&gt;`n&lt;TITLE&gt;[QNotes]&lt;/TITLE&gt;
    &lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1251&quot;/&gt;
    &lt;STYLE type=&quot;text/css&quot;&gt;`n&lt;!--
    *html {BACKGROUND:url(null.png) fixed; FONT: 13px/1.5 &quot;Trebuchet MS&quot;, Tahoma, Arial;
    MARGIN:0 0 24px 0; PADDING-TOP:24px; BORDER:none;}
    div#tabs {HEIGHT:24px; LINE-HEIGHT:20px; WIDTH:100`%; BACKGROUND-COLOR:#FFFFF1;
    POSITION:fixed; TOP:0; LEFT:0; Z-INDEX:1; //POSITION:absolute;
    TOP:expression(document.getElementsByTagName( &#039;body&#039; )[0].scrollTop + &quot;px&quot;);}
    #elements {MARGIN:0 0 0 6`%;}`nul {FLOAT:right;}`n* html div#tabs {MARGIN:0;}
    div#tabs a {COLOR:#004b4b;}
    div#tabs dd {FLOAT:left; /*CLEAR:right;*/ MARGIN-RIGHT:1px; DISPLAY:inline;}
    div#tabs dd a {//WIDTH:70px; TEXT-ALIGN:center; DISPLAY:block;
    PADDING:0 13px 1px; MARGIN-BOTTOM:-1px; CURSOR:pointer; BACKGROUND:#D3E0CF; /*F5F5EA*/
    BORDER:1px solid #AAC1AF; BORDER-BOTTOM:1px solid #DDD; POSITION:relative;
    /*BORDER:solid 1px; BORDER-COLOR:#238 #238 #238 #238;*/}
    * html div#tabs dd a {FLOAT:left;}`n*+html div#tabs dd a {FLOAT:left;}
    div#tabs dd a:hover {COLOR:#F70; BACKGROUND:#FFFFDF; BORDER:1px solid #FFCA95;}
    div#tabs dd a.current:hover, div#tabs a.current {COLOR:#00384a; BACKGROUND:#BBCCBB;
    PADDING:0px 13px 2px; BORDER:1px solid #BBCCBB;}`n#elements .tab{DISPLAY:none;}
    #elements.t1 .t1,#elements.t2 .t2,#elements.t3 .t3,#elements.t4 .t4,#elements.t5 .t5,
    #elements.t6 .t6,#elements.t7 .t7,#elements.t8 .t8 /* ... */ {DISPLAY:block;}`n
    a:link,a:focus,a:hover,a:visited {TEXT-DECORATION:none;}`na:link  {COLOR:#990000;}
    a:hover  {COLOR:blue;}`na:visited {COLOR:#990099;}`n
    div.curvy {POSITION:relative; WIDTH:100`%; COLOR:#000; BACKGROUND:#BBCCBB; /* AAC1AF 9CAF9C */
    MARGIN:0 0 25px 0; PADDING:10px 0px 18px 0px; FONT-FAMILY:monospace;}`n
    #ctl, #cbl, #ctr, #cbr {POSITION:absolute; WIDTH:20px; HEIGHT:20px;
    COLOR:#BBCCBB; BACKGROUND:#FFFFF1; OVERFLOW:hidden; FONT-STYLE:normal; Z-INDEX:1;}
    * html #cbl, #cbr {MARGIN-BOTTOM:-1px; HEIGHT:21px;} /* only for IE */
    #ctr, #cbr {WIDTH:0px;}`n#ctl {TOP:0; LEFT:0;}`n#cbl {BOTTOM:0; LEFT:0;}
    #ctr {TOP:0; RIGHT:0;}`n#cbr {BOTTOM:0; RIGHT:0;}
    div.curvy em b {POSITION:absolute; FONT-SIZE:150px; FONT-FAMILY:Arial;
    COLOR:#BBCCBB; LINE-HEIGHT:40px; FONT-WEIGHT:normal;}`n#ctl b {LEFT:-8px;}
    #ctr b {LEFT:-25px;}`n#cbl b {LEFT:-8px; TOP:-17px;}`n#cbr b {LEFT:-25px; TOP:-17px;}`n
    div.numb {FONT-SIZE:30`%; COLOR:#808080;}
    td.quot1, .quot2 {COLOR:#004a4a; FONT-FAMILY:serif; FONT-SIZE:190`%; FONT-WEIGHT:bold;}
    td.quot1 {PADDING:0 0 0 4`%;}`n/*td.quot2 {PADDING:0 0 0 0;}*/
    td.note {LINE-HEIGHT:1.15em; PADDING:1.4em 0 0 4`%; FONT-SIZE:14px; COLOR:#00384a;}
    font#dt {COLOR:#728776;}`ndiv#url {/*TEXT-TRANSFORM:uppercase; LETTER-SPACING:1pt;*/
    FONT-WEIGHT:bold; COLOR:#990000; /* 55642E C5E2E2 */
    FONT-FAMILY:Tahoma; MARGIN-LEFT:20`%; TEXT-ALIGN:left;
    FONT-SIZE:7.5pt; BORDER-BOTTOM:1px solid #728776;}`n
    #searchbox {WIDTH:220px; HEIGHT:22px; LINE-HEIGHT:18px; BORDER:1px #728776 solid;
    BACKGROUND-COLOR:#FFFFF1;}`n.hidden {DISPLAY:none; POSITION:absolute;}
    --&gt;`n&lt;/STYLE&gt;`n
    &lt;SCRIPT type=&quot;text/javascript&quot;&gt;`n&lt;!--
    var keyTimerId=0;
    function prevEle(e){do{e=e.previousSibling} while(e &amp;&amp; e.nodeType != 1); return e};
    function nextEle(e){do{e=e.nextSibling} while(e &amp;&amp; e.nodeType != 1); return e};
    function isVisible(e){var rows=e.rows; for(var i=0, r; r=rows[i];
    i++){if(!r.className || r.className == &#039;visible&#039;)return true}};
    function find(){var div, tb, h; var val=document.getElementById(&#039;searchbox&#039;).value.toLowerCase();
    var lnks=document.getElementsByTagName(&#039;span&#039;);
    for(var i=0, li; li=lnks[i]; i++){div=li.parentNode.parentNode;
    div.className=((li.textContent || li.innerText).toLowerCase().indexOf(val) != -1) ? &#039;visible&#039; : &#039;hidden&#039;;
    if(!nextEle(div)){tb=div.parentNode.parentNode; h=prevEle(tb);
    if(isVisible(tb)){tb.className=&#039;visible&#039;; h.className=&#039;visible&#039;;tb.parentNode.className=&#039;curvy&#039;;}
    else{tb.className=&#039;hidden&#039;; h.className=&#039;hidden&#039;;tb.parentNode.className=&#039;hidden&#039;;};}}};
    function addInfo(text){var fieldRef;if(fieldRef=document.getElementById(&#039;searchbox&#039;))
    {fieldRef.value = text;find()}return false;`n}
    function I(){`ndocument.write(&#039;&lt;div class=&quot;curvy&quot;&gt;&#039;);
    document.write(&#039;&lt;em id=&quot;ctl&quot;&gt;&lt;b&gt;&amp;bull;&lt;/b&gt;&lt;/em&gt;&lt;em id=&quot;cbl&quot;&gt;&lt;b&gt;&amp;bull;&lt;/b&gt;&lt;/em&gt;&#039;);
    document.write(&#039;&lt;em id=&quot;ctr&quot;&gt;&lt;b&gt;&amp;bull;&lt;/b&gt;&lt;/em&gt;&lt;em id=&quot;cbr&quot;&gt;&lt;b&gt;&amp;bull;&lt;/b&gt;&lt;/em&gt;&#039;);
    document.write(&#039;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100`%&quot;&gt;&lt;tr valign=top&gt;&#039;);
    document.write(&#039;&lt;td width=&quot;12`%&quot; align=&quot;right&quot;&gt;&#039;);
    document.write(&#039;&lt;noindex&gt;&lt;div class=&quot;numb&quot; align=&quot;right&quot;&gt;#&lt;/div&gt;&lt;/noindex&gt;&#039;);
    document.write(&#039;&lt;/td&gt;&#039;);`ndocument.write(&#039;&lt;span&gt;&#039;);`n}`nfunction II(){
    document.write(&#039;&lt;td width=&quot;4`%&quot; align=&quot;right&quot; class=&quot;quot1&quot;&gt;«&lt;/td&gt;&#039;);
    document.write(&#039;&lt;td width=&quot;60`%&quot; class=&quot;note&quot;&gt;&#039;);`n}
    function III(){`ndocument.write(&#039;&lt;/td&gt;&#039;);`ndocument.write(&#039;&lt;/span&gt;&#039;);
    document.write(&#039;&lt;td width=&quot;24`%&quot; valign=&quot;bottom&quot; class=&quot;quot2&quot;&gt;»&lt;/td&gt;&#039;);
    document.write(&#039;&lt;/tr&gt;&lt;/table&gt;&#039;);`ndocument.write(&#039;&lt;/div&gt;&#039;);`n}
    function CrtTabs(){`nvar a = document.getElementById(&#039;tabs&#039;).getElementsByTagName(&#039;a&#039;);
    for(i = 0; i &lt; a.length; i++){ a[i].onclick = function(){ for(j = 0; j &lt; a.length; j++){
    a[j].className = a[j].className.replace(&quot; current&quot;, &quot;&quot;); } this.className += &quot; current&quot;;
    document.getElementById(&#039;elements&#039;).className = this.rel; return false; } } }
    window.onload = CrtTabs`n//--&gt;`n&lt;/SCRIPT&gt;`n&lt;/HEAD&gt;`n
    &lt;BODY bgcolor=#FFFFF1 onDblClick=&quot;document.getElementById(&#039;searchbox&#039;).focus()&quot;&gt;`n
    &lt;DIV id=&quot;tabs&quot;&gt;`n&lt;UL&gt;
    &lt;DD class=&quot;t1&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t1&quot; class=&quot; current&quot;&gt;Всякое&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t2&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t2&quot;&gt;Memori&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t3&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t3&quot;&gt;Цитаты&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t4&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t4&quot;&gt;Ссылки&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t5&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t5&quot;&gt;Инфо&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t6&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t6&quot;&gt;Отжиг&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t7&quot; title=&quot;Закладки&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t7&quot;&gt;Ляссе&lt;/a&gt;&lt;/DD&gt;
    &lt;DD class=&quot;t8&quot; title=&quot;Сегодня мыслей не было...&quot;&gt;&lt;a href=&quot;#&quot; rel=&quot;t8&quot;&gt;Мысли)&lt;/a&gt;&lt;/DD&gt;
    &lt;!-- ... --&gt;`n    
    &lt;DD&gt;&lt;INPUT type=&quot;text&quot; value=&quot;Быстрый поиск&quot; id=&quot;searchbox&quot;
     onfocus=&quot;if(this.value==this.defaultValue)this.value=&#039;&#039;;&quot;
     onblur=&quot;if(!this.value)this.value=this.defaultValue;&quot;
     onkeyup=&quot;clearTimeout(keyTimerId);keyTimerId=setTimeout(&#039;find()&#039;,500);&quot;
     onDblClick=&quot;return addInfo(&#039;&#039;);&quot;&gt;&lt;/DD&gt;
    &lt;/UL&gt;`n&lt;/DIV&gt;`n&lt;DIV id=&quot;elements&quot; class=&quot;t1&quot;&gt;`n`n`n
  ), %A_ScriptDir%\QNotes.html
  }
  Return


QNotesGui:
  f_ClipSaved := ClipboardAll
  Send, {Ctrl Down}{SC02E}{Ctrl UP}    ;c     выделенное
  Sleep, 200                ;      в буфер
  
  Gosub, Get_ExePath_FilePath_CurrentWin
  
  IfWinExist, ahk_id %ID1%
    Gosub, 1GuiClose
  Gui,1:+LastFound +AlwaysOnTop -Caption -Border +Owner +OwnDialogs
  Gui,1: Color,000000,323232
  Gui,1: font,cFFFFFF,
  WinGet, ID1
  Gui,1: Add, Text, gWinMove x0 y0 w220 h9 ;+0x5
  Gui,1: Add, Edit, x8 y10 w204 h64 vCurrText ,
  Gui,1: Add, ListView, -Hdr -E0x200 -Multi Background323232 cD0D0D0 x3 y78 w209 h130 vSelItem HScroll gQNotesChecks AltSubmit count4000,Name
  LV_Add( &quot;&quot;, &quot;Всякое&quot; )  ;LV_Add( &quot;&quot;, 1, &quot;Всякое&quot; )
  LV_Add( &quot;&quot;, &quot;Memori&quot; )
  LV_Add( &quot;&quot;, &quot;Цитаты&quot; )
  LV_Add( &quot;&quot;, &quot;Ссылки&quot; )
  LV_Add( &quot;&quot;, &quot;Инфо&quot; )
  LV_Add( &quot;&quot;, &quot;Отжиг&quot; )
  LV_Add( &quot;&quot;, &quot;Ляссе&quot; )
  LV_Add( &quot;&quot;, &quot;Мысли)&quot; )
  ; ...
  
  CoordMode, Mouse, Screen
  MouseMove, (A_ScreenWidth/2), (A_ScreenHeight/2)
  
  Gui,1: Show, h210 w220, QNotesWin
  ControlFocus, Edit1, QNotesWin
  ControlGetText, CurrText, Edit1, QNotesWin
  Return

1GuiClose:
  Gui,1:Destroy
  Return

WinMove:
  PostMessage, WM_NCLBUTTONDOWN := 0xA1, HTCAPTION := 2
  Return

QNotesChecks:
  If A_GuiEvent = Normal
  {
    LV_GetText(RowText, A_EventInfo)  ;MsgBox, Строка: %A_EventInfo%. Текст: &quot;%RowText%&quot;
    Gui,1:Submit, Hide
    Gosub, QNotesInstall
    Gosub, QNotesAdd
    Gui,1:Destroy
  }
  Return

QNotesAdd:
  FormatTime DT,,dd.MM.yy, h:mm:ss
  
  CoordMode, ToolTip, Screen
  ToolTip, `n     %RowText%   :-|      `n,300,300
  Sleep, 230
  SoundPlay, %A_WinDir%\Media\ding.wav
  
  IfInString RowText, Всякое
    ttab = tab t1
  IfInString RowText, Memori
    ttab = tab t2
  IfInString RowText, Цитаты
    ttab = tab t3
  IfInString RowText, Ссылки
    ttab = tab t4
  IfInString RowText, Инфо
    ttab = tab t5
  IfInString RowText, Отжиг
    ttab = tab t6
  IfInString RowText, Ляссе
    ttab = tab t7
  IfInString RowText, Мысли)
    ttab = tab t8
  ; ...

  Gosub, my_Spec_ActiveWins

  If CurrentWin =         ; если заголовок окна пуст, то...
    CurrentWin = ?Title?

  If File_Path =         ; если переменная File_Path ПУСТА, то...
  {
    If WinEdit             ; если Edit НАЙДЕН, то...
    {
      Note_Path=%WinEdit%
      CurrentWin=+%CurrentWin%
    }
    Else             ; если Edit НЕ найден, то...
    {
      Note_Path=%Exe_Path%
      CurrentWin=++%CurrentWin%
    }
  }
  Else                 ; если переменная File_Path НЕ пуста, то...
  {
    If WinEdit =         ; если Edit НЕ найден, то...
      Note_Path=%File_Path%
    Else             ; если Edit НАЙДЕН, то...
    {
      ;;IfInString,File_Path,/  ; на случай если командные штучки при нем   sic!Space
      ;;{
      ;;  Note_Path=%WinEdit%
      ;;}
      ;;Else
      {
        Note_Path=%File_Path%
        CurrentWin=*%CurrentWin%
      }
    }
  }


  if CurrText =
    Str = %Clipboard%
  else
    Str = %CurrText%

  StringReplace, Str, Str, %A_Space%%A_Space%%A_Space%, &amp;nbsp`;&amp;nbsp`;&amp;nbsp`;, All
  StringReplace, Str, Str, %A_Space%%A_Space%, &amp;nbsp`;&amp;nbsp`;, All
  StringReplace, Str, Str, `r`n%A_Space%, `r`n&amp;nbsp`;, All
  StringReplace, Str, Str, &lt;, &amp;lt`;, All
  StringReplace, Str, Str, &gt;, &amp;gt`;, All
  StringReplace, Str, Str, `n, &lt;br&gt;, All


  if GetKeyState(&quot;Ctrl&quot;,&quot;p&quot;)
  {
    FileAppend,
    (LTrim
    &lt;div class=&quot;%ttab%&quot;&gt;`n&lt;script&gt;I()&lt;/script&gt;`n&lt;script&gt;II()&lt;/script&gt;
    %Str%`n&lt;script&gt;III()&lt;/script&gt;`n&lt;/div&gt;`n`n
    ), %A_ScriptDir%\QNotes.html
  }
  else if CurrText =
  {
    FileAppend,
    (LTrim
    &lt;div class=&quot;%ttab%&quot;&gt;`n&lt;script&gt;I()&lt;/script&gt;
    &lt;div id=&quot;url&quot;&gt;&lt;a target=_blank href=&quot;%Note_Path%&quot;&gt;%CurrentWin%&lt;/a&gt; &lt;font id=&quot;dt&quot;&gt;- %DT%&lt;/font&gt;&lt;/div&gt;
    &lt;script&gt;II()&lt;/script&gt;`n%Str%`n&lt;script&gt;III()&lt;/script&gt;`n&lt;/div&gt;`n`n
    ), %A_ScriptDir%\QNotes.html
  }
  else
  {
    FileAppend,
    (LTrim
    &lt;div class=&quot;%ttab%&quot;&gt;`n&lt;script&gt;I()&lt;/script&gt;`n&lt;script&gt;II()&lt;/script&gt;`n
    %Str%`n&lt;script&gt;III()&lt;/script&gt;`n&lt;/div&gt;`n`n
    ), %A_ScriptDir%\QNotes.html
  }

  Clipboard := f_ClipSaved
  f_ClipSaved =
  ToolTip, `n     %RowText%   :-)      `n,300,300
  Sleep, 110
  ToolTip, `n     %RowText%   `;-)      `n,300,300
  Sleep, 400
  ToolTip
  Return

QNotesAddLast:
  If Not RowText
    Return
  f_ClipSaved := ClipboardAll
  Send, {Ctrl Down}{SC02E}{Ctrl UP}    ;c     выделенное
  Sleep, 200                ;      в буфер
  Gosub, Get_ExePath_FilePath_CurrentWin
  Gosub, QNotesInstall
  Gosub, QNotesAdd
  Return

QNotesRun:
  Run, iexplore.exe %A_ScriptDir%\QNotes.html, , Max UseErrorLevel
  WinWait, [QNotes],, 2
  {
    WinWaitActive, [QNotes],,
    Sleep, 900
    Send, {End 5}
  }
  If ErrorLevel
    Return
  Return

#IfWinActive, QNotesWin
  WheelUp::
  Up::
    TotalRows:=LV_GetCount()
    PresentRow:=LV_GetNext()
    NewRow:=PresentRow - 1
    if (NewRow &lt; 1)
      NewRow:=TotalRows + NewRow
    LV_Modify(NewRow,&quot;+Focus +Select Vis&quot;)
    Return
  WheelDown::
  Down::
    TotalRows:=LV_GetCount()
    PresentRow:=LV_GetNext()
    NewRow:=PresentRow + 1
    if (NewRow &gt; TotalRows)
      NewRow:=NewRow - TotalRows
    LV_Modify(NewRow,&quot;+Focus +Select Vis&quot;)
    Return
#IfWinActive

my_Spec_ActiveWins:
  If WinActive(&quot;ahk_class HH Parent&quot;)
  {
    ControlGet, hWnd, hWnd, , Internet Explorer_Server1, ahk_class HH Parent
    Gosub, GetChmTitlePath
    CurrentWin = %CurrentWin% / %ttlName%
    File_Path = %pthValue%
  }

  If WinActive(&quot;ahk_class IEFrame&quot;)
  || WinActive(&quot;ahk_class Maxthon2_Frame&quot;)
  || WinActive(&quot;Paranoia Browser&quot;)
  {
    CurrentWin = %ttlName%
  }

  If WinActive(&quot;ahk_class MozillaUIWindowClass&quot;) || WinActive(&quot;ahk_class OpWindow&quot;)
  {
    StringSplit, FF_Op_Ttl, sData,`n
    FF_Op_Ttl = %FF_Op_Ttl2%             ; заголовок
    CurrentWin = %FF_Op_Ttl%
    StringReplace, CurrentWin, CurrentWin, `\`&quot;, `&quot;, All
  }

  If WinActive(&quot;ahk_class OpWindow&quot;)
  {
    StringReplace, CurrentWin, CurrentWin, Opera `- `[,, All
    StringTrimRight, CurrentWin, CurrentWin, 1
  }
Return




GetChmTitlePath:
  ;see COM.ahk Standard Library   by Sean   http://www.autohotkey.com/forum/topic22923.html
  ;from: Capture Text from Read Only List
  ;ControlGet, hwnd, hwnd, , , ...
  ;MouseGetPos,,,, hWnd, 3
  COM_AccInit()
  If   pacc :=   COM_AccessibleObjectFromWindow(hWnd)
  {
     Loop, %   COM_AccessibleChildren(pacc, COM_Invoke(pacc,&quot;accChildCount&quot;), varChildren)
     If   paccChild:=NumGet(varChildren,16*A_Index-8)
     ttlName :=COM_Invoke(paccChild,&quot;accName&quot;,0)
     pthValue :=COM_Invoke(paccChild,&quot;accValue&quot;,0)
        , COM_Release(paccChild)
     COM_Release(pacc)
  }
  COM_AccTerm()

  If WinActive(&quot;ahk_class OpusApp&quot;) ; Word
  {
    COM_Init()
    Word := COM_GetActiveObject(&quot;Word.Application&quot;)
    ActiveDocument := com_invoke(Word,&quot;ActiveDocument&quot;)
    pthValue := COM_Invoke(ActiveDocument, &quot;Path&quot;) . &quot;\&quot; . COM_Invoke(ActiveDocument, &quot;Name&quot;)
  }
Return

;------------------------------------------------------------------------------
; COM.ahk Standard Library !FRAGMENT!
; by Sean
; http://www.autohotkey.com/forum/topic22923.html
;------------------------------------------------------------------------------
COM_Init()
{
    Return    DllCall(&quot;ole32\OleInitialize&quot;, &quot;Uint&quot;, 0)
}
COM_AccInit()
{
    COM_Init()
    If Not    DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;oleacc&quot;)
    Return    DllCall(&quot;LoadLibrary&quot;, &quot;str&quot;, &quot;oleacc&quot;)
}
COM_AccessibleObjectFromWindow(hWnd, idObject=-4, IID = &quot;&quot;)
{
    If    DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Uint&quot;, hWnd, &quot;Uint&quot;, idObject, &quot;Uint&quot;, COM_GUID4String(IID, IID ? IID : idObject&amp;0xFFFFFFFF==0xFFFFFFF0 ? &quot;{00020400-0000-0000-C000-000000000046}&quot;:&quot;{618736E0-3C3D-11CF-810C-00AA00389B71}&quot;), &quot;UintP&quot;, pacc)=0
    Return    pacc
}
COM_GUID4String(ByRef CLSID, String)
{
    VarSetCapacity(CLSID, 16)
    DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;Uint&quot;, COM_SysString(String,String), &quot;Uint&quot;, &amp;CLSID)
    Return    &amp;CLSID
}
COM_SysString(ByRef wString, sString)
{
    VarSetCapacity(wString,3+2*nLen:=1+StrLen(sString))
    Return    NumPut(DllCall(&quot;kernel32\MultiByteToWideChar&quot;,&quot;Uint&quot;,0,&quot;Uint&quot;,0,&quot;Uint&quot;,&amp;sString,&quot;int&quot;,nLen,&quot;Uint&quot;,&amp;wString+4,&quot;int&quot;,nLen,&quot;Uint&quot;)*2-2,wString)
}
COM_AccessibleChildren(pacc, cChildren, ByRef varChildren)
{
    VarSetCapacity(varChildren,cChildren*16,0)
    If    DllCall(&quot;oleacc\AccessibleChildren&quot;, &quot;Uint&quot;, pacc, &quot;Uint&quot;, 0, &quot;Uint&quot;, cChildren+0, &quot;Uint&quot;, &amp;varChildren, &quot;UintP&quot;, cChildren:=0)=0
    Return    cChildren
}
COM_AddRef(ppv)
{
    Return    DllCall(NumGet(NumGet(1*ppv)+4), &quot;Uint&quot;, ppv)
}
COM_Invoke(pdsp,name=&quot;&quot;,prm0=&quot;vT_NoNe&quot;,prm1=&quot;vT_NoNe&quot;,prm2=&quot;vT_NoNe&quot;,prm3=&quot;vT_NoNe&quot;,prm4=&quot;vT_NoNe&quot;,prm5=&quot;vT_NoNe&quot;,prm6=&quot;vT_NoNe&quot;,prm7=&quot;vT_NoNe&quot;,prm8=&quot;vT_NoNe&quot;,prm9=&quot;vT_NoNe&quot;)
{
    If    name=
    Return    COM_Release(pdsp)
    If    name contains .
    {
        SubStr(name,1,1)!=&quot;.&quot; ? name.=&quot;.&quot;:name:=SubStr(name,2) . &quot;.&quot;,COM_AddRef(pdsp)
    Loop,    Parse,    name, .
    {
    If    A_Index=1
    {
        name :=    A_LoopField
        Continue
    }
    Else If    name not contains [,(
        prmn :=    &quot;&quot;
    Else If    InStr(&quot;])&quot;,SubStr(name,0))
    Loop,    Parse,    name, [(,&#039;&quot;)]
    If    A_Index=1
        name :=    A_LoopField
    Else    prmn :=    A_LoopField
    Else
    {
        name .=    &quot;.&quot; . A_LoopField
        Continue
    }
    If    A_LoopField!=
        pdsp:=    COM_Invoke(pdsp,name,prmn!=&quot;&quot; ? prmn:&quot;vT_NoNe&quot;)+COM_Release(pdsp)*0,name:=A_LoopField
    Else    Return    prmn!=&quot;&quot; ? COM_Invoke(pdsp,name,prmn,prm0,prm1,prm2,prm3,prm4,prm5,prm6,prm7,prm8):COM_Invoke(pdsp,name,prm0,prm1,prm2,prm3,prm4,prm5,prm6,prm7,prm8,prm9),COM_Release(pdsp)
    }
    }
    sParams    := &quot;0123456789&quot;
    Loop,    Parse,    sParams
        If    (prm%A_LoopField% == &quot;vT_NoNe&quot;)
        {
            sParams    := SubStr(sParams,1,A_Index-1)
            Break
        }
    VarSetCapacity(varg,16*nParams:=StrLen(sParams),0), VarSetCapacity(DispParams,16,0), VarSetCapacity(varResult,32,0), VarSetCapacity(ExcepInfo,32,0)
    Loop,     Parse,    sParams
;        If    prm%A_LoopField%+0==&quot;&quot; || InStr(prm%A_LoopField%,&quot;.&quot;) || prm%A_LoopField%&gt;=0x80000000 || prm%A_LoopField%&lt;-0x80000000
        If    prm%A_LoopField% is not integer
            NumPut(COM_SysString(prm%A_LoopField%,prm%A_LoopField%),NumPut(8,varg,(nParams-A_Index)*16),4)
        Else    NumPut(SubStr(prm%A_LoopField%,1,1)=&quot;+&quot; ? 9:prm%A_LoopField%==&quot;-0&quot; ? (prm%A_LoopField%:=0x80020004)*0+10:3,NumPut(prm%A_LoopField%,varg,(nParams-A_Index)*16+8),-12,&quot;Ushort&quot;)
    If    nParams
        NumPut(nParams,NumPut(&amp;varg,DispParams),4)
    If    (nvk :=    SubStr(name,0)=&quot;=&quot; ? 12:3)=12
        name :=    SubStr(name,1,-1),NumPut(1,NumPut(NumPut(-3,varResult,4)-4,DispParams,4),4)
    Global    COM_HR, COM_LR:=&quot;&quot;
    If    (COM_HR:=DllCall(NumGet(NumGet(1*pdsp)+20),&quot;Uint&quot;,pdsp,&quot;Uint&quot;,&amp;varResult+16,&quot;UintP&quot;,COM_SysString(wname,name),&quot;Uint&quot;,1,&quot;Uint&quot;,1024,&quot;intP&quot;,dispID,&quot;Uint&quot;))=0&amp;&amp;(COM_HR:=DllCall(NumGet(NumGet(1*pdsp)+24),&quot;Uint&quot;,pdsp,&quot;int&quot;,dispID,&quot;Uint&quot;,&amp;varResult+16,&quot;Uint&quot;,1024,&quot;Ushort&quot;,nvk,&quot;Uint&quot;,&amp;DispParams,&quot;Uint&quot;,&amp;varResult,&quot;Uint&quot;,&amp;ExcepInfo,&quot;Uint&quot;,0,&quot;Uint&quot;))!=0&amp;&amp;nParams&amp;&amp;nvk!=12&amp;&amp;(COM_LR:=DllCall(NumGet(NumGet(1*pdsp)+24),&quot;Uint&quot;,pdsp,&quot;int&quot;,dispID,&quot;Uint&quot;,&amp;varResult+16,&quot;Uint&quot;,1024,&quot;Ushort&quot;,12,&quot;Uint&quot;,NumPut(1,NumPut(NumPut(-3,varResult,4)-4,DispParams,4),4)-16,&quot;Uint&quot;,0,&quot;Uint&quot;,0,&quot;Uint&quot;,0,&quot;Uint&quot;))=0
        COM_HR:=0
    Global    COM_VT := NumGet(varResult,0,&quot;Ushort&quot;)
    Return    COM_HR=0 ? COM_VT&gt;1 ? COM_VT=9||COM_VT=13 ? NumGet(varResult,8):COM_VT=8||COM_VT&lt;0x1000&amp;&amp;COM_VariantChangeType(&amp;varResult,&amp;varResult)=0 ? COM_Ansi4Unicode(NumGet(varResult,8)) . COM_VariantClear(&amp;varResult):NumGet(varResult,8):&quot;&quot;:COM_Error(COM_HR,COM_LR,&amp;ExcepInfo,name)
}
COM_Error(hr = &quot;&quot;, lr = &quot;&quot;, pei = &quot;&quot;, name = &quot;&quot;)
{
    Static    bDebug:=1
    If Not    pei
    {
    bDebug:=hr
    Global    COM_HR, COM_LR
    Return    COM_HR&amp;&amp;COM_LR ? COM_LR&lt;&lt;32|COM_HR:COM_HR
    }
    Else If    !bDebug
    Return
    hr ? (VarSetCapacity(sError,1023),VarSetCapacity(nError,10),DllCall(&quot;kernel32\FormatMessageA&quot;,&quot;Uint&quot;,0x1000,&quot;Uint&quot;,0,&quot;Uint&quot;,hr&lt;&gt;0x80020009 ? hr : (bExcep:=1)*(hr:=NumGet(pei+28)) ? hr : hr:=NumGet(pei+0,0,&quot;Ushort&quot;)+0x80040200,&quot;Uint&quot;,0,&quot;str&quot;,sError,&quot;Uint&quot;,1024,&quot;Uint&quot;,0),DllCall(&quot;user32\wsprintfA&quot;,&quot;str&quot;,nError,&quot;str&quot;,&quot;0x%08X&quot;,&quot;Uint&quot;,hr,&quot;Cdecl&quot;)) : sError:=&quot;The COM Object may not be a valid Dispatch Object!`n`tFirst ensure that COM Library has been initialized through COM_Init().`n&quot;, lr ? (VarSetCapacity(sError2,1023),VarSetCapacity(nError2,10),DllCall(&quot;kernel32\FormatMessageA&quot;,&quot;Uint&quot;,0x1000,&quot;Uint&quot;,0,&quot;Uint&quot;,lr,&quot;Uint&quot;,0,&quot;str&quot;,sError2,&quot;Uint&quot;,1024,&quot;Uint&quot;,0),DllCall(&quot;user32\wsprintfA&quot;,&quot;str&quot;,nError2,&quot;str&quot;,&quot;0x%08X&quot;,&quot;Uint&quot;,lr,&quot;Cdecl&quot;)) : &quot;&quot;
    MsgBox, 260, COM Error Notification, % &quot;Function Name:`t&quot;&quot;&quot; . name . &quot;&quot;&quot;`nERROR:`t&quot; . sError . &quot;`t(&quot; . nError . &quot;)&quot; . (bExcep ? SubStr(NumGet(pei+24) ? DllCall(NumGet(pei+24),&quot;Uint&quot;,pei) : &quot;&quot;,1,0) . &quot;`nPROG:`t&quot; . COM_Ansi4Unicode(NumGet(pei+4)) . COM_SysFreeString(NumGet(pei+4)) . &quot;`nDESC:`t&quot; . COM_Ansi4Unicode(NumGet(pei+8)) . COM_SysFreeString(NumGet(pei+8)) . &quot;`nHELP:`t&quot; . COM_Ansi4Unicode(NumGet(pei+12)) . COM_SysFreeString(NumGet(pei+12)) . &quot;,&quot; . NumGet(pei+16) : &quot;&quot;) . (lr ? &quot;`n`nERROR2:`t&quot; . sError2 . &quot;`t(&quot; . nError2 . &quot;)&quot; : &quot;&quot;) . &quot;`n`nWill Continue?&quot;
    IfMsgBox, No, Exit
}
COM_Ansi4Unicode(pString, nSize = &quot;&quot;)
{
    If (nSize = &quot;&quot;)
        nSize:=DllCall(&quot;kernel32\WideCharToMultiByte&quot;, &quot;Uint&quot;, 0, &quot;Uint&quot;, 0, &quot;Uint&quot;, pString, &quot;int&quot;, -1, &quot;Uint&quot;, 0, &quot;int&quot;,  0, &quot;Uint&quot;, 0, &quot;Uint&quot;, 0)
    VarSetCapacity(sString, nSize)
    DllCall(&quot;kernel32\WideCharToMultiByte&quot;, &quot;Uint&quot;, 0, &quot;Uint&quot;, 0, &quot;Uint&quot;, pString, &quot;int&quot;, -1, &quot;str&quot;, sString, &quot;int&quot;, nSize + 1, &quot;Uint&quot;, 0, &quot;Uint&quot;, 0)
    Return    sString
}
COM_SysFreeString(bstr)
{
        DllCall(&quot;oleaut32\SysFreeString&quot;, &quot;Uint&quot;, bstr)
}
COM_VariantChangeType(pvarDst, pvarSrc, vt = 8)
{
    Return    DllCall(&quot;oleaut32\VariantChangeTypeEx&quot;, &quot;Uint&quot;, pvarDst, &quot;Uint&quot;, pvarSrc, &quot;Uint&quot;, 1024, &quot;Ushort&quot;, 0, &quot;Ushort&quot;, vt)
}
COM_VariantClear(pvar)
{
        DllCall(&quot;oleaut32\VariantClear&quot;, &quot;Uint&quot;, pvar)
}
COM_Release(ppv)
{
    Return    DllCall(NumGet(NumGet(1*ppv)+8), &quot;Uint&quot;, ppv)
}
COM_AccTerm()
{
    COM_Term()
    If h:=    DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;oleacc&quot;)
    Return    DllCall(&quot;FreeLibrary&quot;, &quot;Uint&quot;, h)
}
COM_Term()
{
    Return    DllCall(&quot;ole32\OleUninitialize&quot;)
}
COM_GetDefaultInterface(pdisp)
{
    DllCall(NumGet(NumGet(1*pdisp) +12), &quot;Uint&quot;, pdisp , &quot;UintP&quot;, ctinf)
    If    ctinf
    {
    DllCall(NumGet(NumGet(1*pdisp)+16), &quot;Uint&quot;, pdisp, &quot;Uint&quot; , 0, &quot;Uint&quot;, 1024, &quot;UintP&quot;, ptinf)
    DllCall(NumGet(NumGet(1*ptinf)+12), &quot;Uint&quot;, ptinf, &quot;UintP&quot;, pattr)
    DllCall(NumGet(NumGet(1*pdisp)+ 0), &quot;Uint&quot;, pdisp, &quot;Uint&quot; , pattr, &quot;UintP&quot;, ppv)
    DllCall(NumGet(NumGet(1*ptinf)+76), &quot;Uint&quot;, ptinf, &quot;Uint&quot; , pattr)
    DllCall(NumGet(NumGet(1*ptinf)+ 8), &quot;Uint&quot;, ptinf)
    If    ppv
    DllCall(NumGet(NumGet(1*pdisp)+ 8), &quot;Uint&quot;, pdisp),    pdisp := ppv
    }
    Return    pdisp
}
COM_GetActiveObject(ProgID)
{
    DllCall(&quot;oleaut32\GetActiveObject&quot;, &quot;Uint&quot;, SubStr(ProgID,1,1)=&quot;{&quot; ? COM_GUID4String(ProgID,ProgID) : COM_CLSID4ProgID(ProgID,ProgID), &quot;Uint&quot;, 0, &quot;UintP&quot;, punk)
    DllCall(NumGet(NumGet(1*punk)+0), &quot;Uint&quot;, punk, &quot;Uint&quot;, COM_GUID4String(IID_IDispatch,&quot;{00020400-0000-0000-C000-000000000046}&quot;), &quot;UintP&quot;, pdisp)
    DllCall(NumGet(NumGet(1*punk)+8), &quot;Uint&quot;, punk)
    Return    COM_GetDefaultInterface(pdisp)
}
COM_CLSID4ProgID(ByRef CLSID, ProgID)
{
    VarSetCapacity(CLSID, 16)
    DllCall(&quot;ole32\CLSIDFromProgID&quot;, &quot;Uint&quot;, COM_SysString(ProgID,ProgID), &quot;Uint&quot;, &amp;CLSID)
    Return    &amp;CLSID
}
COM_SysStringLen(bstr)
{
    Return    DllCall(&quot;oleaut32\SysStringLen&quot;, &quot;Uint&quot;, bstr)
}
;------------------------------------------------------------------------------
; END  COM.ahk Standard Library !FRAGMENT!
;------------------------------------------------------------------------------




Get_ExePath_FilePath_CurrentWin:
  ;mk:@MSITStore:D:\SCRIPTS\script-coding14.chm::/web/viewtopicf546.html
  ;------------------------------------------------------
  WinGetActiveTitle, CurrentWin

  WinGet, PID_Target, PID, % &quot;ahk_id &quot; WinExist(&quot;A&quot;)
  Exe_Path := GetModuleFileNameEx( PID_Target )

  ;;SetTitleMatchMode, Slow
  ;;WinGetTitle, CurrentWinSlow, ahk_id %CurrentWinID%
  ;;SetTitleMatchMode, Fast

  WinGetClass, CurrentWinClass, ahk_id %CurrentWinID%

  ControlGetText, WinEdit, Edit1, ahk_id %CurrentWinID%
  ;------------------------------------------------------

  PID_Target := WinExist( &quot;A&quot; ) ; получаем ID ОКНА
  If Not PID_Target ; если ОКНО не найдено...
  {
    MsgBox, Окно не найдено!
    Return ; конец скрипта
  }
  WinGet, PID_Target, PID, ahk_id %PID_Target% ; получаем PID найденного окна ОКНА
  Exe_Path := GetModuleFileNameEx( PID_Target ) ; вызываем функцию получения пути процесса ОКНА
  If Not Exe_Path ; если что-то не так...
  {
    MsgBox, Процесс не существует, или к нему нет доступа
    Return ; конец скрипта
  }
  Com_Line := GetRemoteCommandLine( PID_Target ) ; вызываем функцию получения ком. строки ОКНА
  If Not Com_Line ; если что-то не так...
  {
    MsgBox, Процесс не существует, или к нему нет доступа
    Return ; конец скрипта
  }
  StringReplace, File_Path, Com_Line, %Exe_Path% ; удаляем из строки путь к ОКНУ
  StringReplace, File_Path, File_Path, &quot;,, All ; удаляем из строки все кавычки, если они есть
  StringReplace, File_Path, File_Path, hh.exe,, All ; вслучаееслиоткрытчерезhh.exe


  If WinActive(&quot;ahk_class CabinetWClass&quot;)
  {
    hWnd := WinExist(&quot;A&quot;) 
    WinGetClass wClass, ahk_id %hWnd% 
      Res := GetWindowsExplorerPath(hWnd)
    File_Path = %Res%
  }

  ;;IfWinActive, ahk_class IEFrame
  ;;  sServer := &quot;iexplore&quot;     ; firefox, opera, iexplore

  IfWinActive, ahk_class OpWindow
    sServer := &quot;opera&quot;         ; firefox, opera, iexplore

  IfWinActive, ahk_class MozillaUIWindowClass
    sServer := &quot;firefox&quot;     ; firefox, opera, iexplore

  If WinActive(&quot;ahk_class OpWindow&quot;)
  || WinActive(&quot;ahk_class MozillaUIWindowClass&quot;)
  ;;|| WinActive(&quot;ahk_class IEFrame&quot;)
  {
    Gosub, get_FF_Op_UrlTtl
    StringReplace, sData, sData, `&quot;`,`&quot;, `r`n, All
    StringTrimRight, sData, sData, 1
    StringTrimLeft, sData, sData, 1
    StringSplit, File_Path, sData,`n
    File_Path = %File_Path1%
  }

  If WinActive(&quot;ahk_class IEFrame&quot;)
  || WinActive(&quot;ahk_class OpusApp&quot;)  ; Word
  || WinActive(&quot;ahk_class Maxthon2_Frame&quot;)
  || WinActive(&quot;Paranoia Browser&quot;)
  || WinActive(&quot;NetCaptor&quot;)
  {
    IfWinActive, ahk_class IEFrame
      ControlGet, hwnd, hwnd, , Internet Explorer_Server1, ahk_class IEFrame
    IfWinActive, ahk_class Maxthon2_Frame
      ControlGet, hwnd, hwnd, , Internet Explorer_Server1, ahk_class Maxthon2_Frame
    IfWinActive, Paranoia Browser
      ControlGet, hwnd, hwnd, , Internet Explorer_Server1, Paranoia Browser
    IfWinActive, NetCaptor
      ControlGet, hwnd, hwnd, , Internet Explorer_Server1, NetCaptor

    Gosub, GetChmTitlePath
    File_Path = %pthValue%
  }

  File_Path = %File_Path% ; избавляемся от возможных пробелов в начале строки
Return


;SEE:: Retrieve AddressBar of Firefox through DDE Message
get_FF_Op_UrlTtl:
  /*
  XCLASS_DATA  := 0x2000
  XCLASS_FLAGS := 0x4000
  XTYP_EXECUTE := 0x0050 | XCLASS_FLAGS
  XTYP_POKE    := 0x0090 | XCLASS_FLAGS
  XTYP_REQUEST := 0x00B0 | XCLASS_DATA
  */
  ;;sServer := &quot;opera&quot;         ; firefox, opera, iexplore
  
  sTopic  := &quot;WWW_GetWindowInfo&quot;
  sItem   := &quot;0xFFFFFFFF&quot;
  
  idInst  := DdeInitialize()
  
  hServer := DdeCreateStringHandle(idInst, sServer)
  hTopic  := DdeCreateStringHandle(idInst, sTopic )
  hItem   := DdeCreateStringHandle(idInst, sItem  )
  
  hConv := DdeConnect(idInst, hServer, hTopic)
  hData := DdeClientTransaction(0x20B0, hConv, hItem)   ; XTYP_REQUEST
  sData := DdeAccessData(hData)
  
  DdeFreeStringHandle(idInst, hServer)
  DdeFreeStringHandle(idInst, hTopic )
  DdeFreeStringHandle(idInst, hItem  )
  
  DdeUnaccessData(hData)
  DdeFreeDataHandle(hData)
  DdeDisconnect(hConv)
  DdeUninitialize(idInst)
  
  DdeInitialize(pCallback = 0, nFlags = 0) {
     DllCall(&quot;DdeInitialize&quot;, &quot;UintP&quot;, idInst, &quot;Uint&quot;, pCallback, &quot;Uint&quot;, nFlags, &quot;Uint&quot;, 0)
     Return idInst
  }
  DdeUninitialize(idInst) {
     Return DllCall(&quot;DdeUninitialize&quot;, &quot;Uint&quot;, idInst)
  }
  DdeConnect(idInst, hServer, hTopic, pCC = 0) {
     Return DllCall(&quot;DdeConnect&quot;, &quot;Uint&quot;, idInst, &quot;Uint&quot;, hServer, &quot;Uint&quot;, hTopic, &quot;Uint&quot;, pCC)
  }
  DdeDisconnect(hConv) {
     Return DllCall(&quot;DdeDisconnect&quot;, &quot;Uint&quot;, hConv)
  }
  DdeAccessData(hData) {
     Return DllCall(&quot;DdeAccessData&quot;, &quot;Uint&quot;, hData, &quot;Uint&quot;, 0, &quot;str&quot;)
  }
  DdeUnaccessData(hData) {
     Return DllCall(&quot;DdeUnaccessData&quot;, &quot;Uint&quot;, hData)
  }
  DdeFreeDataHandle(hData) {
     Return DllCall(&quot;DdeFreeDataHandle&quot;, &quot;Uint&quot;, hData)
  }
  DdeCreateStringHandle(idInst, sString, nCodePage = 1004) {         ; CP_WINANSI = 1004
     Return DllCall(&quot;DdeCreateStringHandle&quot;, &quot;Uint&quot;, idInst, &quot;Uint&quot;, &amp;sString, &quot;int&quot;, nCodePage)
  }
  DdeFreeStringHandle(idInst, hString) {
     Return DllCall(&quot;DdeFreeStringHandle&quot;, &quot;Uint&quot;, idInst, &quot;Uint&quot;, hString)
  }
  DdeClientTransaction(nType, hConv, hItem, sData = &quot;&quot;, nFormat = 1, nTimeOut = 10000) {   ; CF_TEXT = 1
     Return DllCall(&quot;DdeClientTransaction&quot;, &quot;Uint&quot;, sData = &quot;&quot; ? 0 : &amp;sData, &quot;Uint&quot;, sData = &quot;&quot; ? 0 : StrLen(sData)+1, &quot;Uint&quot;, hConv, &quot;Uint&quot;, hItem, &quot;Uint&quot;, nFormat, &quot;Uint&quot;, nType, &quot;Uint&quot;, nTimeOut, &quot;UintP&quot;, nResult)
  }
  Return

GetModuleFileNameEx(PID) { ; shimanov - www.autohotkey.com/forum/viewtopic.php?p=54838#54838
  hpr := DllCall( &quot;OpenProcess&quot;, UInt,1040, Int,0, UInt,PID )
  If ( ErrorLevel or !hpr )
      Return
  VarSetCapacity( Name,255 )
  DllCall( &quot;psapi.dll\GetModuleFileNameExA&quot;, UInt,hPr, UInt,0, Str,Name, UInt,255 )
  DllCall( &quot;CloseHandle&quot;, hPr )
  Return, Name
  }

GetRemoteCommandLine( p_pid_target ) ; функция получения командной строки для процесса (по его PID&#039;у)
{
  hp_target := DllCall( &quot;OpenProcess&quot;, &quot;UInt&quot;, 0x10, &quot;Int&quot;, false, &quot;UInt&quot;, p_pid_target ) ; открываем хэндл для PID процесса...
  ; ...с правами для чтения 0x10 = PROCESS_VM_READ (нужны для ReadProcessMemory) и без наследования хэндла
  If ( ErrorLevel OR hp_target = 0 ) ; если почему-либо не удалось открыть хэндл (или он открыт для несуществующего PID&#039;а)...
    Goto, Return_2 ; перейти к закрытию хэндла и выйти из функции

  hm_kernel32 := DllCall( &quot;GetModuleHandle&quot;, &quot;Str&quot;, &quot;kernel32.dll&quot; ) ; узнаем хэндл библиотеки kernel32.dll
  pGetCommandLineA := DllCall( &quot;GetProcAddress&quot;, &quot;UInt&quot;, hm_kernel32, &quot;Str&quot;, &quot;GetCommandLineA&quot; ) ; получаем указатель...
  ; ...на адрес функции GetCommandLineA (ANSI), содержащейся в kernel32.dll

  buffer_size = 6 ; количество байт для переменной
  VarSetCapacity( buffer, buffer_size ) ; обеспечиваем достаточную вместимость переменной
  DllCall( &quot;ReadProcessMemory&quot;, &quot;UInt&quot;, hp_target, &quot;UInt&quot;, pGetCommandLineA, &quot;UInt&quot;, &amp;buffer, &quot;UInt&quot;, buffer_size, &quot;UInt&quot;, 0 )
  ; для хэндла PID&#039;а получаем перенаправление функцией GetCommandLineA на указатель на адрес командной строки...
  ; ...и кладем его по адресу &quot;buffer&quot; в памяти

  Loop, 4 ; преобразовываем указатель на адрес командной строки в целое число
    ppCommandLine += ( ( *( &amp;buffer+A_Index ) ) &lt;&lt; ( 8*( A_Index-1 ) ) ) ; создаем целое число, складывая его байты

  buffer_size = 4 ; количество байт для переменной
  VarSetCapacity( buffer, buffer_size, 0 ) ; обеспечиваем достаточную вместимость переменной, и очищаем её
  DllCall( &quot;ReadProcessMemory&quot;, &quot;UInt&quot;, hp_target, &quot;UInt&quot;, ppCommandLine, &quot;UInt&quot;, &amp;buffer, &quot;UInt&quot;, buffer_size, &quot;UInt&quot;, 0 )
  ; для хэндла PID&#039;а читаем адрес командной строки, и кладем его по адресу &quot;buffer&quot; в памяти

  Loop, 4 ; преобразовываем адрес в целое число
    pCommandLine += ( ( *( &amp;buffer+A_Index-1 ) ) &lt;&lt; ( 8*( A_Index-1 ) ) ) ; создаем целое число, складывая его байты

  ; Адрес командной строки получен, теперь извлекаем его содержимое
  buffer_size = 520 ; столько символов будем читать из командной строки (мне кажется, длиннее быть не может)
  VarSetCapacity( result, buffer_size, 1 ) ; обеспечиваем достаточную вместимость переменной, делаем её побайтной
  DllCall( &quot;ReadProcessMemory&quot;, &quot;UInt&quot;, hp_target, &quot;UInt&quot;, pCommandLine, &quot;UInt&quot;, &amp;result, &quot;UInt&quot;, buffer_size, &quot;UInt&quot;, 0 )
  ; для хэндла PID&#039;а читаем командную строку, и кладем её по адресу &quot;result&quot; в памяти (просто помещаем значение в переменную)

  Return_2: ; метка перехода к закрытию хэндла
  DllCall( &quot;CloseHandle&quot;, &quot;UInt&quot;, hp_target ) ; закрываем хэндл
  Return, result ; возвращаем полную командную строку для PID&#039;а процесса
  } ; конец функции


; Определение текущего пути в окне Проводника
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 
  }


WriteFile(file,data)
{
   Handle :=  DllCall(&quot;CreateFile&quot;,&quot;str&quot;,file,&quot;Uint&quot;,0x40000000
                  ,&quot;Uint&quot;,0,&quot;UInt&quot;,0,&quot;UInt&quot;,4,&quot;Uint&quot;,0,&quot;UInt&quot;,0)
   Loop
   {
     if strlen(data) = 0
        break
     StringLeft, Hex, data, 2         
     StringTrimLeft, data, data, 2 
     Hex = 0x%Hex%
     DllCall(&quot;WriteFile&quot;,&quot;UInt&quot;, Handle,&quot;UChar *&quot;, Hex
     ,&quot;UInt&quot;,1,&quot;UInt *&quot;,UnusedVariable,&quot;UInt&quot;,0)
    }
 
   DllCall(&quot;CloseHandle&quot;, &quot;Uint&quot;, Handle)
   return
}

CrtIco:
Ico =
( join
00000100010010100000010020006804000016000000280000001000000020000000010020
00000000000004000000000000000000000000000000000000ffccc7ffffccc7ffffccc7ff
ffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffff
ccc7ffffccc7ffffccc7ffffccc7ffffccc7fffffcf5fffffcf5fffffcf5fffffcf5fffffc
f5fffffcf5fffffcf5fffffcf6fffffcf6fffffcf6fffffcf5fffffcf5fffffcf5fffffcf5
ffffccc7ffffccc7fffffcf6fffdfbf5ffd5cfc9fff6f3eefffffcf7fffffcf7fff8f5efff
c6bdb8ffd9d3cefffffdf8fffffcf6fffffcf6fffffcf5fffffcf5ffffccc7ffffccc7ffff
fdf7fff1eee9ff170705ff726663fffffdfafffffdfaffd4cdcaff120401ff140502ff5d50
4cffebe7e2fffffdf7fffffcf6fffffcf5ffffccc7ffffccc7fffff9f7fffef9f8ff6f5f5c
ff23110effdad3d1fffffbfafff9f5f4ff41312eff170805ff675956ff443331ffe3dbd9ff
fff8f7fffff8f6ffffccc7ffffccc7fffff7f2fffff8f5ffd8cbc7ff4e342fff917d78ffff
fbf8fffffaf8ffa99c9aff140504ffa19491ffb2a6a3ff837572fffff7f2fffff6f0ffffcc
c7ffffccc7ffffedebfffff0eefff6ece9ff604b46ff49302cffd4c7c4fffff5f4fffaf1ef
ff67514dff5b4540fffdf2f1fff7e8e6ffffedeaffffebe8ffffccc7ffffccc7ffffe4e1ff
ffe8e6ffffedecff97827dff37211dff6d5955fff9eceafffff1efffbdaaa6ff3f2823ffb7
a19dffffeae8ffffe5e2ffffe2dfffffccc7ffffccc7fffcddd6fffde1dbfffde7e2ffd6c5
c0ff36221eff513d39ffa7928dfffeeeebfff4e4e1ff543f3aff4f3935fff2dedafffde2db
fffcddd6ffffccc7ffffccc7fff0ccc0fff0d0c6ffebd1c9fff7e5dfff4f3c38ff4d3936ff
5c4844ffd0bdb7fff8e5dfffa6918bff281410ffa78f89fff4d8cefff1d0c5ffffccc7ffff
ccc7ffffe9e7fffbe8e6ff7f6c6affd1c4c2ffa99896ff261412ff887673ff5a4744fff4e9
e8fff2e6e5ff3b2724ff45312efff6e6e4ffffebe9ffffccc7ffffccc7fffff1edfffff3ef
ffdacdcaff473733ff9d8d89ff1d0d09ff877774ff887874ff63534ffffff9f7ff73625fff
190805ffccbebbfffff2efffffccc7ffffccc7fffff2effffff3f1fffff5f3ffc8bcbaff2a
1a17ff0c0000ff62524ffffff9f7ff746562ff453431ff281714ff170704ffd3c7c5fffff4
f2ffffccc7ffffccc7fffff3effffff3f0fffff4f1fffff5f2ffe9dfdcff9a8d8affdbd0cc
fffff6f3fffff6f3ffc5b7b4ff8a7c79ffc4b8b4fffef5f2fffff5f1ffffccc7ffffccc7ff
fff4effffff4effffff4effffff5f0fffff5f0fffff5f0fffff5f0fffff5f0fffff5f0ffff
f5f0fffff5f1fffff5f0fffff5f0fffff4efffffccc7ffffccc7ffffccc7ffffccc7ffffcc
c7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7ffffccc7
ffffccc7ffffccc7ffffccc7ff000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000
000000
)
return</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Fri, 27 May 2011 11:16:53 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=48718#p48718</guid>
		</item>
	</channel>
</rss>
