<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11719&amp;type=atom" />
	<updated>2016-06-14T16:44:49Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11719</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105227#p105227" />
			<content type="html"><![CDATA[<p>Вот последнее, думаю, идеально подойдёт в этом случае. Нижайше кланяюсь и спасибо за Ваше время.</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-06-14T16:44:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105227#p105227</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105226#p105226" />
			<content type="html"><![CDATA[<p>Всё-таки я неправ, окно создаётся уже при первом <em>Gui, Add</em>. Тем не менее <em>WinSet, TransColor</em> можно применять к нему только после <em>Gui, Show</em>.<br />Проблему первого появления можно решить так:<br /></p><div class="codebox"><pre><code>Gui, 2: Color, 0000D1
Gui, 2: +AlwaysOnTop -Caption +Hwndh_time
Gui, 2: Font, s7 Bold cFFFF00
Gui, 2: Add, Text, w55 Center, TEXT
Gui, 2: +Lastfound
;WinSet, TransColor, 0000D1
Gui, 2: Show, x920 y0 Hide
Gui, 2: Hide
DllCall(&quot;AnimateWindow&quot;, &quot;UInt&quot;, h_time, &quot;Int&quot;, 2500, &quot;UInt&quot;, 0x80000)
Return</code></pre></div><p><em>DllCall(&quot;AnimateWindow&quot;)</em> не дружит с <em>WinSet, TransColor</em>.<br />Но можно использовать <strong>WinSet, TransColor, Color [N], WinTitle</strong>.<br /></p><div class="codebox"><pre><code>Gui, 2: Color, 0000D1
Gui, 2: +AlwaysOnTop -Caption +Hwndh_time
Gui, 2: Font, s17 Bold cFFFF00
Gui, 2: Add, Text, w55 Center, TEXT
Gui, 2: Show, h0 w0
WinSet, TransColor, 0000D1 5, ahk_id %h_time%
Gui, 2: Show, x920 y0 w100 h50

Tr := 5
Loop, 25
{
Tr := Tr + 10
WinSet, TransColor, 0000D1 %Tr%, ahk_id %h_time%
Sleep, 100
}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-06-14T15:50:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105226#p105226</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105224#p105224" />
			<content type="html"><![CDATA[<p>Да, можно ещё само окно сразу показать без содержимого, ведь будучи прозрачным его всё равно не видно, потом убирать в хайд, а за тем являть через &quot;AnimateWindow&quot;, тогда уже приемлемей. Но плавности всё равно нет, а <strong>teadrinker</strong> заглядывая сюда убедиться, что все знаки препинания на месте, держит свою тайну при себе. Умиляясь за чашечкой горячего и ароматного напитка&nbsp; тому, как юный дилетант ломает голову над очевидными вещами. =/</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-06-14T15:26:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105224#p105224</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105221#p105221" />
			<content type="html"><![CDATA[<p>Если в таймере добавить TransColor, то все работает.<br /></p><div class="codebox"><pre><code>WinSet, TransColor, 0000D1, ahk_id %h_time%</code></pre></div><p>Правда в момент появления окна виден фон.</p>]]></content>
			<author>
				<name><![CDATA[Nikva]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27416</uri>
			</author>
			<updated>2016-06-14T13:52:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105221#p105221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105219#p105219" />
			<content type="html"><![CDATA[<p>Почему в таком случае первый пример работает? Второй лишь модифицирован вызовом виндовской функции, вместо стандартного способа &quot;Gui, Show&quot;.</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-06-14T13:29:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105219#p105219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105217#p105217" />
			<content type="html"><![CDATA[<p>WinSet, TransColor, 0000D1 - эта команда не может воздействовать не несуществующее окно.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-06-14T11:38:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105217#p105217</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105216#p105216" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong><br />И об этом вопрос в том числе. Первое их появление происходит как-то &quot;ломанно&quot;, а потом если по кнопке жмякать, то уже плавно. Но если в первом примере появление текста окна происходит на прозрачном фоне, то во втором, при схожих условиях фон остаётся с установленным вначале цветом. То есть, к нему не применяется &quot;WinSet, TransColor, ColorID&quot;. За то <a href="http://forum.script-coding.com/viewtopic.php?pid=77566#p77566">в примере</a> <strong>teadrinker</strong>, вызываемая &quot;AnimateWindow&quot; катает своё окно идеально, даже если изменить параметр со слайда на то же появление. В чём секрет?</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-06-14T11:05:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105216#p105216</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105215#p105215" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>а во втором они появляются плавно но фон не прозрачный</p></blockquote></div><p>Запустил второй скрипт. Часы появляются, но не плавно.<br />AutoHotkey 1.1.23.5 Unicode 32-bit, Windows XP.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-06-14T10:16:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105215#p105215</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Изменение прозрачности фона окна при вызове "AnimateWindow"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=105214#p105214" />
			<content type="html"><![CDATA[<p>Здоровья всем.<br />Подскажите пожалуйста:<br />Вариант 1.<br /></p><div class="codebox"><pre><code>
clock := 0

Gui, Add, Button,,Кнопка
Gui, Show, w100 h100

Gui, 2: Color, 0000D1
Gui, 2: +AlwaysOnTop -Caption +Hwndh_time
Gui, 2: Font, s7 Bold cFFFF00
Gui, 2: Add, Text, w55 Center
Gui, 2: +Lastfound
WinSet, TransColor, 0000D1
Gui, 2: Show, x920 y0 Hide
Return

ButtonКнопка:
	if (clock == 0) {
		clock := 1
		Gui, 2: Show, x920 y0
		SetTimer, Timer, 1000
	} else {
		clock := 0
		Gui, 2: Show, Hide
		SetTimer, Timer, off
	}
return

Timer:
	ControlSetText, Static1, % A_Hour &quot;:&quot; A_Min &quot;:&quot; A_Sec, ahk_id%h_time%
Return

GuiClose:
ExitApp
</code></pre></div><p>Вариант 2.<br /></p><div class="codebox"><pre><code>
clock := 0

Gui, Add, Button,,Кнопка
Gui, Show, w100 h100

Gui, 2: Color, 0000D1
Gui, 2: +AlwaysOnTop -Caption +Hwndh_time
Gui, 2: Font, s7 Bold cFFFF00
Gui, 2: Add, Text, w55 Center
Gui, 2: +Lastfound
WinSet, TransColor, 0000D1
Gui, 2: Show, x920 y0 Hide
Return

ButtonКнопка:
	if (clock == 0) {
		clock := 1
		SetTimer, Timer, 1000
	} else {
		clock := 0
		Gui, 2: Show, Hide
		SetTimer, Timer, off
	}
return

Timer:
	ControlSetText, Static1, % A_Hour &quot;:&quot; A_Min &quot;:&quot; A_Sec, ahk_id%h_time%
	DllCall(&quot;AnimateWindow&quot;, &quot;UInt&quot;, h_time
						   , &quot;Int&quot;, 950
						   , &quot;UInt&quot;, 0x80000)
Return

GuiClose:
ExitApp
</code></pre></div><p>В первом варианте по нажатию кнопки вверху появляются часы на прозрачном фоне, а во втором они появляются плавно но фон не прозрачный. Как сделать его прозрачным и во втором варианте? И в чём причина того, что появление в первый раз происходит как то &quot;криво&quot; что-ли, но не плавно точно, а все последующие появления уже как и ожидается?</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-06-14T10:09:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=105214#p105214</id>
		</entry>
</feed>
