<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: возможно ли у GUI окна сделать прозрачность и проницаемость?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17344&amp;type=atom" />
	<updated>2022-08-28T19:00:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17344</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: возможно ли у GUI окна сделать прозрачность и проницаемость?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=154575#p154575" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, ну понятно. Когда надо будет только проницаемость поставить буду использовать в связке с WS_EX_LAYERED. А когда еще и прозрачность увеличить - то тогда с Transparent.<br />Ок, спасибо за помощь.</p>]]></content>
			<author>
				<name><![CDATA[pavel.garshin.01]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42521</uri>
			</author>
			<updated>2022-08-28T19:00:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=154575#p154575</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: возможно ли у GUI окна сделать прозрачность и проницаемость?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=154570#p154570" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>pavel.garshin.01 пишет:</cite><blockquote><div class="codebox"><pre><code>WinSet, Transparent, % 100, Untitled			;регулируем значение от 0 до 255</code></pre></div></blockquote></div><p>Знак процента здесь не нужен, у меня он есть только из-за того, что вместо конкретного значения используется выражение 255*(t ? 0.25 : 1).<br /></p><div class="quotebox"><cite>pavel.garshin.01 пишет:</cite><blockquote><p>я так и не смог понять, как работает проницаемость по отдельности</p></blockquote></div><p>Действительно, оно работает только в связке с WS_EX_LAYERED. В моём примере WS_EX_LAYERED устанавливается автоматически при добавлении прозрачности:<br /></p><div class="codebox"><pre><code>WS_EX_LAYERED := 0x80000

Gui, Show, w300 h300, My Gui
WinGet, exStyle, ExStyle, My Gui
MsgBox, % exStyle &amp; WS_EX_LAYERED

WinSet, Transparent, 255, My Gui
WinGet, exStyle, ExStyle, My Gui
MsgBox, % Format(&quot;{:#x}&quot;, exStyle &amp; WS_EX_LAYERED)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-08-28T13:25:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=154570#p154570</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: возможно ли у GUI окна сделать прозрачность и проницаемость?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=154566#p154566" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, Спасибо.<br />Работает как часы.</p><p>Я понял как выставлять отдельно прозрачность:<br /></p><div class="codebox"><pre><code>
Gui, +AlwaysOnTop
Gui, Add, Edit, vMainEdit WantTab W600 R20
Gui, Show,, Untitled
WinSet, Transparent, % 100, Untitled			;регулируем значение от 0 до 255
</code></pre></div><p>Так же, я так понимаю, что за проницаемость отвечает свойство WS_EX_TRANSPARENT. Однако, я так и не смог понять, как работает проницаемость по отдельности:<br /></p><div class="codebox"><pre><code>
Gui, +AlwaysOnTop
Gui, Add, Edit, vMainEdit WantTab W600 R20
Gui, Show,, Untitled
Gui, % &quot;+&quot;  . &quot;E&quot; . WS_EX_TRANSPARENT := 0x20		;не работает
;Gui, % &quot;-&quot;  . &quot;E&quot; . WS_EX_TRANSPARENT := 0x20		;и так не работает
</code></pre></div><p>Начал гуглить. И нашел вариант, где он работает в связке со свойством WS_EX_LAYERED:<br /></p><div class="codebox"><pre><code>
WS_EX_TRANSPARENT := 0x20
WS_EX_LAYERED := 0x80000
Gui, +AlwaysOnTop +LastFound
Gui, Add, Edit, vMainEdit WantTab W600 R20
Gui, Show,, Untitled

WinSet, ExStyle, % &quot;+&quot; WS_EX_LAYERED|WS_EX_TRANSPARENT
</code></pre></div><p>Нашел справку о Расширенных стилях окон Windows:<br /><a href="https://docs.microsoft.com/ru-ru/windows/win32/winmsg/extended-window-styles">https://docs.microsoft.com/ru-ru/window … dow-styles</a><br />WS_EX_LAYERED - делает окно многоуровневым. Это и есть проницаемость? Но почему у Вас в примере оно работает без WS_EX_LAYERED? И за что тогда отвечает WS_EX_TRANSPARENT?</p><p>Можете пожалуйста объяснить?</p>]]></content>
			<author>
				<name><![CDATA[pavel.garshin.01]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42521</uri>
			</author>
			<updated>2022-08-28T08:50:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=154566#p154566</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: возможно ли у GUI окна сделать прозрачность и проницаемость?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=154565#p154565" />
			<content type="html"><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>Gui, +AlwaysOnTop
Gui, Add, Edit, vMainEdit WantTab W600 R20
Gui, Show,, Untitled
t := false
Return

$F1::
   t := !t
   WinSet, Transparent, % 255*(t ? 0.25 : 1), Untitled
   Gui, % (t ? &quot;+&quot; : &quot;-&quot;) . &quot;E&quot; . WS_EX_TRANSPARENT := 0x20
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-08-28T00:20:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=154565#p154565</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: возможно ли у GUI окна сделать прозрачность и проницаемость?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=154563#p154563" />
			<content type="html"><![CDATA[<p>Допустим создаю gui с текстовым полем. И необходимо по горячей клавише увеличить прозрачность этого окна на 75%, и включить полную проницаемость. Т.е. чтобы в области окна можно было манипулировать средой рабочего стола и других окон, что находятся за ним.<br />Не нашел в свойствах GUI такую возможность. <br />Скажите пожалуйста возможно ли это реализовать?</p><p>Код окна:<br /></p><div class="codebox"><pre><code>
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Gui, +Resize  ; Задаем окну свойство изменять размер.
Gui, Add, Edit, vMainEdit WantTab W600 R20
Gui, Show,, Untitled
	
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[pavel.garshin.01]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42521</uri>
			</author>
			<updated>2022-08-27T19:57:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=154563#p154563</id>
		</entry>
</feed>
