<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Изменение цвета ссылки в GUI]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16299</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16299&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Изменение цвета ссылки в GUI».]]></description>
		<lastBuildDate>Wed, 28 Apr 2021 22:37:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Изменение цвета ссылки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=147540#p147540</link>
			<description><![CDATA[<p>Вот пример:<br /></p><div class="codebox"><pre><code>Gui, Font, s24
Gui, Add, Text, c1049A9, Some Text - I&#039;m Blue

Gui, Add, Link, y+5 hwndhLink1 cLime, &lt;a href=&quot;https://autohotkey.com&quot;&gt;Some Link - I&#039;m Lime&lt;/a&gt;
SetSysLinkColor(hLink1)

Gui, Add, Link, y+5 hwndhLink2, &lt;a href=&quot;https://autohotkey.com&quot;&gt;Some Other Link - I&#039;m Red&lt;/a&gt;
SetSysLinkColor(hLink2, &quot;Red&quot;)
Gui, Show

Loop 3 {
   Sleep, 300
   SetSysLinkColor(hLink2, 0)
   Sleep, 300
   SetSysLinkColor(hLink2, 0xFF0000)
}
return

GuiClose:
   ExitApp

SetSysLinkColor(hLink, color := &quot;&quot;)  {
   static WM_USER := 0x400, LM_SETITEM := WM_USER + 0x302
        , LIF_ITEMINDEX := 0x1, LIF_STATE := 0x2
        , LIS_DEFAULTCOLORS := 0x10
        , L_MAX_URL_LENGTH := 2048 + 32 + 3, MAX_LINKID_TEXT := 48
        
   if (color != &quot;&quot;)  {
      hGui := DllCall(&quot;GetParent&quot;, Ptr, hLink, Ptr)
      Gui, %hGui%: Font, c%color%
      GuiControl, %hGui%: Font, %hLink%
   }
   VarSetCapacity(LITEM, 4*4 + (MAX_LINKID_TEXT + L_MAX_URL_LENGTH)*2, 0)
   NumPut(LIF_ITEMINDEX | LIF_STATE, LITEM)
   NumPut(LIS_DEFAULTCOLORS, LITEM, 8)
   NumPut(LIS_DEFAULTCOLORS, LITEM, 12)
   while DllCall(&quot;SendMessage&quot;, Ptr, hLink, UInt, LM_SETITEM, Ptr, 0, Ptr, &amp;LITEM)
      NumPut(A_Index, LITEM, 4, &quot;UInt&quot;)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 28 Apr 2021 22:37:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=147540#p147540</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Изменение цвета ссылки в GUI]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=147536#p147536</link>
			<description><![CDATA[<p>Бывает, что цвет ссылки в GUI по умолчанию (<em>Gui, Add, Link</em>) не сочетается с изменным фоном GUI (<em>Gui, Color, 73716F</em>). Можно ли этот цвет ссылки менять на свой? Пробовал добавлять стиль для ссылки, как в HTML, но не работает.</p>]]></description>
			<author><![CDATA[null@example.com (peterverhovensky)]]></author>
			<pubDate>Wed, 28 Apr 2021 21:27:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=147536#p147536</guid>
		</item>
	</channel>
</rss>
