<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Скрытие заголовка приложения VLC Player]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12571&amp;type=atom" />
	<updated>2017-04-13T12:01:53Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12571</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115042#p115042" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>msgbox % f(&quot;a&quot;)

f(var)
{
   title := &quot;ok&quot;
   return title
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-13T12:01:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115042#p115042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115041#p115041" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, изначально ф-ия подразумевалась для универсальности скрипта (для работы с разными окнами). Предлагаете задавать координаты для перемещения контрола в параметрах ф-ии наряду с именем окна и контрола? Т.е. вынести найденый контрол с присвоением переменной за пределы функции невозможно?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-13T11:55:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115041#p115041</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115040#p115040" />
			<content type="html"><![CDATA[<p>Вставьте ControlMove в функцию.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-13T10:56:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115040#p115040</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115039#p115039" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, контрол перемещается внутри окна. Мне необходимо разместить контрол на экране аналогично размещению окна.<br />Название контрола указывал как постоянное, хотя оно меняется. А как указать найденное в функции опытным путем имя - не знаю, т.е. не знаю, как присвоить ему постоянное значение.<br /></p><div class="codebox"><pre><code>#SingleInstance Force
SetTitleMatchMode 2
CoordMode, screen
1::
   ShowControl(&quot;Ace Player&quot;, &quot;VLC MSW video&quot;)
   ControlMove, VLC MSW video 0DDE90801, 1180, 628, 870, 490
return

ShowControl(wintitle, ctrl){
   static Toggle
   win := WinExist(wintitle)
   WinGet, ActiveControlList, ControlList
   if Toggle:=!Toggle
   {
      Loop, Parse, ActiveControlList, `n
      {
         if InStr(A_LoopField, ctrl)
         {
            DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 1, &quot;UInt&quot;, 4)
            ControlGetPos, CtrlX, CtrlY, CtrlW, CtrlH, %A_LoopField%
            WinSet, Region, % CtrlX &quot;-&quot; CtrlY &quot; W&quot; CtrlW &quot; H&quot; CtrlH
 			MsgBox % A_LoopField 
         break
         }
      }
   } else {
      WinSet, Region, , % wintitle
      DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 0, &quot;UInt&quot;, 4)
      }
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-13T08:50:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115039#p115039</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115038#p115038" />
			<content type="html"><![CDATA[<p>Вы можете посмотреть, чему равна переменная A_LoopField с помощью msgbox.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-12T21:43:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115038#p115038</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115037#p115037" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, я только понял, что скрипт получает список всех контролов, далее находит в них контрол с необходимым содержанием в имени. В качестве имени контрола я вижу там только <em>%A_LoopField%</em>, когда скрипт получает его координаты расположения в окне.</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-12T20:55:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115037#p115037</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115036#p115036" />
			<content type="html"><![CDATA[<p>А вы поняли как работает скрипт из 31 поста?<br />Там этот момент учитывается.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-12T20:46:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115036#p115036</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115034#p115034" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, а как присвоить имя найденному контролу в функции (контролу, с содержанием в имени &quot;VLC MSW video&quot;)?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-12T20:23:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115034#p115034</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115033#p115033" />
			<content type="html"><![CDATA[<p>controlmove.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-04-12T19:33:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115033#p115033</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=115032#p115032" />
			<content type="html"><![CDATA[<p>Подскажите, пожалуйста, как задать нужный размер и расположение на экране выделенному контролу? В данном случае, это изображение видеоряда в плеере VLC. Окну VLC задаю нужный мне размер и расположение следующей командой:<br /></p><div class="codebox"><pre><code>WinMove, ahk_class QWidget , , 1180, 628, 870, 490
</code></pre></div><p>Но необходио, чтобы данному размеру и расположению соответствовала именно область изображения плеера, которая осталась в результате:<br /></p><div class="codebox"><pre><code>
ShowControl(&quot;Ace Player&quot;, &quot;VLC MSW video&quot;)

ShowControl(wintitle, ctrl){
   static Toggle
   win := WinExist(wintitle)
   WinGet, ActiveControlList, ControlList
   if Toggle:=!Toggle
   {
      Loop, Parse, ActiveControlList, `n
      {
         if InStr(A_LoopField, ctrl)
         {
            DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 1, &quot;UInt&quot;, 4)
            ControlGetPos, CtrlX, CtrlY, CtrlW, CtrlH, %A_LoopField%
            WinSet, Region, % CtrlX &quot;-&quot; CtrlY &quot; W&quot; CtrlW &quot; H&quot; CtrlH
            break
         }
      }
   } else {
      WinSet, Region, , % wintitle
      DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 0, &quot;UInt&quot;, 4)
      }
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-04-12T17:49:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=115032#p115032</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114382#p114382" />
			<content type="html"><![CDATA[<p>У вас в коде при каждом обращении к функции проверяется if Toggle:=!Toggle.<br />То есть, если мы не будем сохранять текущее значение toggle, то результат всегда будет 1.<br /></p><div class="codebox"><pre><code>toggle := &quot;&quot;
Toggle:=!Toggle
msgbox % Toggle</code></pre></div><p>Переменная же win высчитывается только в первом случае, хотя используется в обоих:</p><div class="codebox"><pre><code>DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 0, &quot;UInt&quot;, 4)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-03-29T20:13:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114382#p114382</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114378#p114378" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, спасибо, работает! А по какому признаку в данном примере становится ясно, что переменные необходимо объявить статическими? Иными словами, как понять необходимость сохранения их значений между вызовами?</p>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-03-29T19:30:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114378#p114378</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114371#p114371" />
			<content type="html"><![CDATA[<p>Объявите переменные toggle и win как статические.<br /></p><div class="quotebox"><blockquote><p>Статические переменные: чтобы сохранить значение переменной между вызовами, ее можно объявить статической</p></blockquote></div><p><a href="http://www.script-coding.com/AutoHotkey/Functions.html">http://www.script-coding.com/AutoHotkey/Functions.html</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-03-29T13:25:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114371#p114371</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114362#p114362" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, спасибо! Установил переключение одной клавишей, но возврат окна в исходное положение не работает после попытки заключить сценарий в функцию. Укажите на ошибку, пожалуйста.<br /></p><div class="codebox"><pre><code>
f1::
ShowControl(&quot;Ace Player&quot;, &quot;VLC MSW video&quot;)
return

ShowControl(wintitle, ctrl)
{
SetTitleMatchMode 2
if Toggle:=!Toggle
{
   win := WinExist(wintitle)
   WinGet, ActiveControlList, ControlList
   Loop, Parse, ActiveControlList, `n
   {
      if InStr(A_LoopField, ctrl)
      {
         DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 1, &quot;UInt&quot;, 4)
         ControlGetPos, CtrlX, CtrlY, CtrlW, CtrlH, %A_LoopField%
         WinSet, Region, % CtrlX &quot;-&quot; CtrlY &quot; W&quot; CtrlW &quot; H&quot; CtrlH
         break
      }
}
} else {
   WinSet, Region, , % wintitle
   DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 0, &quot;UInt&quot;, 4)
}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[becauseim]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33149</uri>
			</author>
			<updated>2017-03-29T09:09:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114362#p114362</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скрытие заголовка приложения VLC Player]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=114359#p114359" />
			<content type="html"><![CDATA[<p>Надо еще окну вернуть первоначальное его отображение:<br /></p><div class="codebox"><pre><code>DllCall(&quot;dwmapi\DwmSetWindowAttribute&quot;, &quot;Ptr&quot;, win, &quot;UInt&quot;, 2, &quot;Int*&quot;, 0, &quot;UInt&quot;, 4)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-03-28T23:02:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=114359#p114359</id>
		</entry>
</feed>
