<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7349&amp;type=atom" />
	<updated>2012-07-15T12:04:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7349</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61581#p61581" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Pokerist пишет:</cite><blockquote><p>Что-то сложновато для меня.</p></blockquote></div><p>А что там сложного?</p><div class="codebox"><pre><code>hwnd1 := TrackToolTip(&quot;tip1&quot;, 500, 500)</code></pre></div><p>Первый параметр — текст ToolTip&#039;а, второй — координата X, третий — Y. Функция возвращает хэндл окна (в данном случае <em>hwnd1</em>), который можно использовать для манипуляций с ним и для его закрытия.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-07-15T12:04:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61581#p61581</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61580#p61580" />
			<content type="html"><![CDATA[<p>Что-то сложновато для меня. Пришла в голову мысль писать в файл все параметры нужных ToolTip и выводить из отдельным скриптом. Это даст ещё 20 штук. А там и третий подключить можно <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" />.&nbsp; Не знаю правда, насколько это будет грузить систему.</p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2012-07-15T11:58:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61580#p61580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61579#p61579" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="quotebox"><cite>Pokerist пишет:</cite><blockquote><p>Ему можно придать такие же свойства, как у подсказок, чтобы ImageSearch видел окно под ним?</p></blockquote></div><p>Можно создавать любое количество ToolTip&#039;ов таким образом:</p></blockquote></div><p>Ого! Спасибо! Попробую разобраться. <img src="//forum.script-coding.com/img/smilies/roll.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2012-07-15T11:25:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61579#p61579</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61577#p61577" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Pokerist пишет:</cite><blockquote><p>Ему можно придать такие же свойства, как у подсказок, чтобы ImageSearch видел окно под ним?</p></blockquote></div><p>Не экспериментировал с этим. Можно создавать любое количество ToolTip&#039;ов таким образом:<br /></p><div class="codebox"><pre><code>hwnd1 := TrackToolTip(&quot;tip1&quot;, 500, 500)
hwnd2 := TrackToolTip(&quot;tip2&quot;, 600, 500)
return

!1::WinClose, ahk_id %hwnd1%
!2::WinClose, ahk_id %hwnd2%

TrackToolTip( sText
            , x = &quot;&quot;   ; если не указаны, то вблизи курсора
            , y = &quot;&quot;
            , sTitle = &quot;&quot;
            , h_icon = 0   ; h_icon — 0: None, 1:Info, 2: Warning, 3: Error, n &gt; 3: предполагается hIcon
            , CloseButton = 0
            , nColorBack = 0xFFFFE1
            , nColorText = 0
            , BallonTip = 0   ; BalloonTip — это ToolTip с хвостиком
            , w = 400)  ; максимальная ширина
{
   TTS_NOPREFIX := 2, TTS_ALWAYSTIP := 1, TTS_BALLOON := 0x40, TTS_CLOSE := 0x80

   hWnd := DllCall(&quot;CreateWindowEx&quot;, UInt, WS_EX_TOPMOST := 8
                                   , Str, &quot;tooltips_class32&quot;, Str, &quot;&quot;
                                   , UInt, TTS_NOPREFIX|TTS_ALWAYSTIP|(CloseButton ? TTS_CLOSE : 0)|(BallonTip ? TTS_BALLOON : 0)
                                   , Int, 0, Int, 0, Int, 0, Int, 0
                                   , Ptr, 0, Ptr, 0, Ptr, 0, Ptr, 0)

   if (x = &quot;&quot; || y = &quot;&quot;)
   {
      CoordMode, Mouse
      MouseGetPos, xtt, ytt
      xtt := x = &quot;&quot; ? xtt + 10 : x
      ytt := y = &quot;&quot; ? ytt + 10 : y
   }
   Else
      xtt := x, ytt := y

   NumPut(VarSetCapacity(TOOLINFO, A_PtrSize = 4 ? 48 : 72, 0), TOOLINFO, &quot;UInt&quot;)
   NumPut(0x20, TOOLINFO, 4, &quot;UInt&quot;)      ; TTF_TRACK = 0x20
   NumPut(&amp;sText, TOOLINFO, A_PtrSize = 4 ? 36 : 48, &quot;UInt&quot;)

   DHW := A_DetectHiddenWindows
   DetectHiddenWindows, On
   WinWait, ahk_id %hWnd%

   WM_USER := 0x400
   SendMessage, WM_USER + 24,, w         ; TTM_SETMAXTIPWIDTH
   SendMessage, WM_USER + (A_IsUnicode ? 50 : 4),, &amp;TOOLINFO   ; TTM_ADDTOOL
   SendMessage, WM_USER + 19, RGB_to_BGR(nColorBack)   ; TTM_SETTIPBKCOLOR
   SendMessage, WM_USER + 20, RGB_to_BGR(nColorText)   ; TTM_SETTIPTEXTCOLOR
   SendMessage, WM_USER + (A_IsUnicode ? 33 : 32), h_icon, &amp;sTitle      ; TTM_SETTITLEA и TTM_SETTITLEW
   SendMessage, WM_USER + (A_IsUnicode ? 57 : 12),, &amp;TOOLINFO     ; TTM_UPDATETIPTEXTA и TTM_UPDATETIPTEXTW
   SendMessage, WM_USER + 18,, xtt|(ytt&lt;&lt;16)   ; TTM_TRACKPOSITION
   SendMessage, WM_USER + 17, 1, &amp;TOOLINFO ; TTM_TRACKACTIVATE

   WinGetPos,,, W, H
   if (xtt + W + 10 &gt; A_ScreenWidth || ytt + H + 10 &gt; A_ScreenHeight)
   {
      WinHide
      xtt := xtt + W + 10 &gt; A_ScreenWidth ? A_ScreenWidth - W - 10 : xtt
      ytt := ytt + H + 10 &gt; A_ScreenHeight ? A_ScreenHeight - H - 10 : ytt
      SendMessage, 1042,, xtt|(ytt&lt;&lt;16)   ; TTM_TRACKPOSITION
      WinShow
   }

   DetectHiddenWindows, % DHW
   Return hWnd
}

RGB_to_BGR(RGB)
{
   CurrentFormat := A_FormatInteger
   SetFormat, IntegerFast, H
   C := SubStr(&quot;0x000000&quot;, 1, -(StrLen(RGB+0) - 2)) . SubStr(RGB+0, 3)
   BGR := RegExReplace(C, &quot;0x(..)(..)(..)&quot;, &quot;0x$3$2$1&quot;)
   SetFormat, IntegerFast, %CurrentFormat%
   Return BGR
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-07-15T10:51:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61577#p61577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61568#p61568" />
			<content type="html"><![CDATA[<p>Я не очень знаком с этой стороной AHK.&nbsp; &nbsp; &nbsp;Ему можно придать такие же свойства, как у подсказок, чтобы ImageSearch видел окно под ним?</p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2012-07-14T23:43:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61568#p61568</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61567#p61567" />
			<content type="html"><![CDATA[<p>А обычное окно GUI не подойдёт?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-07-14T21:55:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61567#p61567</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Можно ли как-то увеличить количество  ToolTip?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61566#p61566" />
			<content type="html"><![CDATA[<p>Задача у меня следующая. Распознаю в окне с помощью ImageSearch&nbsp; до 50 элементов. Хочу их «пометить» с помощью ToolTip, чтобы было видно,&nbsp; что уже обнаружено. Но 20 штук&nbsp; ToolTip мне мало. </p><p>Возможно, эту задачу можно решить по-другому, но я других элементов в AHK, которые не закрывали бы главное окно для ImageSearch не нашёл. </p><p>Заранее спасибо за помощь!</p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2012-07-14T21:10:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61566#p61566</id>
		</entry>
</feed>
