<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Вырез части окна по данным из ini файла]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16156&amp;type=atom" />
	<updated>2021-03-24T06:12:15Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16156</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из ini файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146904#p146904" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Помогите поправить скрипт.</p>]]></content>
			<author>
				<name><![CDATA[Werwolf]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39565</uri>
			</author>
			<updated>2021-03-24T06:12:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146904#p146904</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из ini файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146781#p146781" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Помогите поправить скрипт.</p>]]></content>
			<author>
				<name><![CDATA[Werwolf]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39565</uri>
			</author>
			<updated>2021-03-18T00:54:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146781#p146781</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из ini файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146671#p146671" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>__Михаил__ пишет:</cite><blockquote><p>Всё так и не можете сделать математические операции в переменных?</p></blockquote></div><p>Да.</p>]]></content>
			<author>
				<name><![CDATA[Werwolf]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39565</uri>
			</author>
			<updated>2021-03-07T21:11:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146671#p146671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из ini файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146649#p146649" />
			<content type="html"><![CDATA[<p>Всё так и не можете сделать математические операции в переменных?</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-03-06T19:37:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146649#p146649</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Вырез части окна по данным из ini файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146646#p146646" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Помогите поправить скрипт.</p><p>Скрипт autohotkey вырезает область из конкретного окна экселя и оформляет его как gui (данные берет из ini).</p><div class="codebox"><pre><code>Set := SubStr(A_ScriptName, 1, -4) . &quot;.ini&quot;
OnExit, Exit

;Чтение настроек:
IniRead, X, % Set, Win, X, 860
IniRead, Y, % Set, Win, Y, 121
IniRead, W, % Set, Win, W, 350
IniRead, H, % Set, Win, H, 550
IniRead, Color, % Set, Win, Color, 123456
IniRead, XM, % Set, Win, XM, -860
IniRead, YM, % Set, Win, YM, -121
IniRead, GW, % Set, Win, GW, 350
IniRead, GH, % Set, Win, GH, 550


F3::
WinExist(&quot;ahk_class TMainForm&quot;)
WinSet, Style, -0x00C00000			; WS_CAPTION
WinSet, Style, -0x00040000			; WS_SIZEBOX
WinSet, Style, +0x80000000			; WS_POPUP

WinSet, Region, % X &quot;-&quot; Y &quot; W&quot; W &quot; H&quot; H		; 860-121 W350 H550

Gui, +HWNDhGui
Gui, Color, % Color
Gui, Show, % &quot;w&quot; GW &quot; h&quot; GH		; w350 h550
DllCall(&quot;SetParent&quot;, &quot;Ptr&quot;, WinExist(), &quot;Ptr&quot;, hGui)
WinMove, % XM, % YM			; -860, -121
Return


Exit:	; Сохранить при выходе файл настроек.
IniWrite, % X, % Set, Win, X
IniWrite, % Y, % Set, Win, Y
IniWrite, % W, % Set, Win, W
IniWrite, % H, % Set, Win, H
IniWrite, % Color, % Set, Win, Color
IniWrite, % XM, % Set, Win, XM
IniWrite, % YM, % Set, Win, YM
IniWrite, % GW, % Set, Win, GW
IniWrite, % GH, % Set, Win, GH
ExitApp
Return</code></pre></div><br /><p>За координаты и ширину-высоту вырезаемой области отвечает вот этот кусок:<br />WinSet, Region, % X &quot;-&quot; Y &quot; W&quot; W &quot; H&quot; H		; 860-121 W350 H550<br />(сейчас размеры вырезаемой области четко прописаны в абсолютных величинах)</p><p>Как изменить скрипт чтобы он брал параметры координат-ширины-высоты вырезаемой области из txt или ini файла - как процент от размеров окна ?<br />WinSet, Region, ШиринаОкна*0,51-ВысотаОкна*0,48 W(ШиринаОкна*0,36) H*(ВысотаОкна*0,43)</p>]]></content>
			<author>
				<name><![CDATA[Werwolf]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39565</uri>
			</author>
			<updated>2021-03-06T19:18:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146646#p146646</id>
		</entry>
</feed>
