<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Вырез части окна по данным из txt файла]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16120&amp;type=atom" />
	<updated>2021-02-27T14:33:38Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16120</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146546#p146546" />
			<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-02-27T14:33:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146546#p146546</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146540#p146540" />
			<content type="html"><![CDATA[<p>__Михаил__, спасибо.<br />но пока скрипт не работает.<br />Он создает пустое окно, заполненное синим цветом.<br />Программа называется эксель.</p><p>И я спрашивал про вырезание области - заданной процентами от размеров основного окна:&nbsp; WinSet, Region, ШиринаОкна*0,51-ВысотаОкна*0,48 W(ШиринаОкна*0,36) H*(ВысотаОкна*0,43)</p><p>А в ini - сейчас просто выписываются размеры вырезаемой области.</p>]]></content>
			<author>
				<name><![CDATA[Werwolf]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39565</uri>
			</author>
			<updated>2021-02-27T03:22:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146540#p146540</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146533#p146533" />
			<content type="html"><![CDATA[<p>Возможно окно не верно указано, взял данные из шапки.<br />Можно заменить на текущее окно так:</p><div class="codebox"><pre><code>WinExist(&quot;A&quot;) </code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-02-26T18:43:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146533#p146533</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146511#p146511" />
			<content type="html"><![CDATA[<p>__Михаил__, спасибо за ответ.<br />Я запустил этот скрипт, но почему-то он не работает.</p><p>Запускаю эксель, нажимаю F3 - создается gui, заполненное однотонным синим цветом.</p>]]></content>
			<author>
				<name><![CDATA[Werwolf]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39565</uri>
			</author>
			<updated>2021-02-26T03:16:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146511#p146511</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146473#p146473" />
			<content type="html"><![CDATA[<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>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-02-23T12:57:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146473#p146473</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146472#p146472" />
			<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-02-23T12:33:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146472#p146472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Вырез части окна по данным из txt файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146467#p146467" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Помогите поправить скрипт.</p><p>Скрипт autohotkey вырезает область из конкретного окна и оформляет его как gui.<br /></p><div class="codebox"><pre><code>WinExist(&quot;ahk_class TMainForm&quot;) 
WinSet, Style, -0x00C00000			; WS_CAPTION
WinSet, Style, -0x00040000			; WS_SIZEBOX
WinSet, Style, +0x80000000			; WS_POPUP
WinSet, Region, 860-121 W350 H550
Gui, +HWNDhGui
Gui, Color, 123456
Gui, Show, w350 h550  
DllCall(&quot;SetParent&quot;, &quot;Ptr&quot;, WinExist(), &quot;Ptr&quot;, hGui)
WinMove -860, -121
Return</code></pre></div><p>За координаты и ширину-высоту вырезаемой области отвечает вот этот кусок:<br />WinSet, Region, 860-121 W350 H550<br />Как изменить скрипт чтобы он брал параметры координат-ширины-высоты вырезаемой области из 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-02-23T04:24:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146467#p146467</id>
		</entry>
</feed>
