<?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=16969&amp;type=atom" />
	<updated>2022-02-15T15:05:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16969</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничение размеров tooltip]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152213#p152213" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, огромное спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Morux2112]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41251</uri>
			</author>
			<updated>2022-02-15T15:05:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152213#p152213</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничение размеров tooltip]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152203#p152203" />
			<content type="html"><![CDATA[<p>Ну, если по-умному, то так:<br /></p><div class="codebox"><pre><code>#Persistent
Hook := new WindowsHook(WH_CALLWNDPROC := 4, &quot;CallWndProc&quot;, maxWidth := 200, false)
ToolTip % &quot;Здравствуйте. Можно ли как-то ограничить размеры ToolTip, например, по ширине? Чтобы длинный текст писался в столбик, а не одной большой строчкой.&quot;
Return

CallWndProc(nCode, wParam, lParam) {
   static TTM_TRACKPOSITION := 0x0412, TTM_SETMAXTIPWIDTH := 0x0418
   msg := NumGet(lParam + A_PtrSize*2, &quot;UInt&quot;)
   hwnd := NumGet(lParam + A_PtrSize*3)
   if (msg = TTM_TRACKPOSITION)
      DllCall(&quot;SendMessage&quot;, &quot;Ptr&quot;, hwnd, &quot;UInt&quot;, TTM_SETMAXTIPWIDTH, &quot;Int&quot;, 0, &quot;Int&quot;, A_EventInfo)
   DllCall(&quot;CallNextHookEx&quot;, &quot;Ptr&quot;, 0, &quot;int&quot;, nCode, &quot;Ptr&quot;, wParam, &quot;Ptr&quot;, lParam, &quot;Ptr&quot;)
}

class WindowsHook {
   __New(type, callback, eventInfo := &quot;&quot;, isGlobal := true) {
      this.pCallback := RegisterCallback(callback, &quot;Fast&quot;, 3, eventInfo)
      this.hHook := DllCall(&quot;SetWindowsHookEx&quot;, &quot;Int&quot;, type, &quot;Ptr&quot;, this.pCallback
                                              , &quot;Ptr&quot;, !isGlobal ? 0 : DllCall(&quot;GetModuleHandle&quot;, &quot;UInt&quot;, 0, &quot;Ptr&quot;)
                                              , &quot;UInt&quot;, isGlobal ? 0 : DllCall(&quot;GetCurrentThreadId&quot;), &quot;Ptr&quot;)
   }
   __Delete() {
      DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;Ptr&quot;, this.hHook)
      DllCall(&quot;GlobalFree&quot;, &quot;Ptr&quot;, this.pCallback, &quot;Ptr&quot;)
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-02-15T09:03:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152203#p152203</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничение размеров tooltip]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152200#p152200" />
			<content type="html"><![CDATA[<p>Ну, по идее ничего не мешает разбивать все тексты на куски по десть (или сколько надо) слов и встраивать знак переноса в конце каждой группы.</p>]]></content>
			<author>
				<name><![CDATA[Foma]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31521</uri>
			</author>
			<updated>2022-02-15T08:37:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152200#p152200</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничение размеров tooltip]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152195#p152195" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, текст в ToolTip идет через множество переменных, и количество слов в них заранее не известно. Поэтому &#039;n проходит мимо. Хотя может и можно как-то реализовать, но идей нет.</p>]]></content>
			<author>
				<name><![CDATA[Morux2112]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41251</uri>
			</author>
			<updated>2022-02-15T05:30:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152195#p152195</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ограничение размеров tooltip]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152194#p152194" />
			<content type="html"><![CDATA[<p>Есть такой символ: <span style="color: red">`n</span>, попробуйте использовать его.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-02-15T00:35:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152194#p152194</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Ограничение размеров tooltip]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152193#p152193" />
			<content type="html"><![CDATA[<p>Здравствуйте. Можно ли как-то ограничить размеры ToolTip, например, по ширине? Чтобы длинный текст писался в столбик, а не одной большой строчкой.</p>]]></content>
			<author>
				<name><![CDATA[Morux2112]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41251</uri>
			</author>
			<updated>2022-02-15T00:17:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152193#p152193</id>
		</entry>
</feed>
