<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Альтернатива WinSet]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11996&amp;type=atom" />
	<updated>2016-09-10T18:19:28Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=11996</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107469#p107469" />
			<content type="html"><![CDATA[<p>Проверил Вашим кодом и немного модифицированным (чтобы все через dllcall) - ничего не меняется.<br /></p><div class="codebox"><pre><code>LWIN &amp; RButton::
hWnd := WinExist(&quot;ahk_exe myGame.exe&quot;)
DeleteBorder(hWnd)
Return

DeleteBorder(hwnd)  {
   static GWL_STYLE := -16, GWL_EXSTYLE := -20, WS_CAPTION := 0xC00000, WS_THICKFRAME := 0x40000
        , WS_MINIMIZE := 0x20000000, WS_MAXIMIZE := 0x1000000, WS_SYSMENU := 0x80000
        , WS_EX_DLGMODALFRAME := 0x1, WS_EX_CLIENTEDGE := 0x200, WS_EX_STATICEDGE := 0x20000
        , SWP_FRAMECHANGED := 0x0020, SWP_NOMOVE := 0x0002, SWP_NOSIZE := 0x0001
        , SWP_NOZORDER := 0x0004, SWP_NOOWNERZORDER := 0x0200
   
   lStyle := DllCall(&quot;GetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_STYLE, Ptr)
   lExStyle := DllCall(&quot;GetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_EXSTYLE, Ptr)
   
   lStyle &amp;= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU)
   lExStyle &amp;= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE)
   
   DllCall(&quot;SetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_STYLE, Ptr, lStyle)
   DllCall(&quot;SetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_EXSTYLE, Ptr, lExStyle)
   
   DllCall(&quot;SetWindowPos&quot;, Ptr, hwnd, Int, 0, Int, 0, Int, 0, Int, 0, Int, 0, Ptr, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER)
}</code></pre></div><p>А вот к примеру в этой же игре WinMove в сравнении с DllCall(&quot;SetWindowPos&quot;, &quot;UInt&quot;, hWnd, &quot;UInt&quot;, 0, &quot;Int&quot;, 0, &quot;Int&quot;, 0, &quot;Int&quot;, w/2, &quot;Int&quot;, h, &quot;UInt&quot;, 0x400) не срабатывает нормально, а второй вариант отрабатывает правильно.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2016-09-10T18:19:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107469#p107469</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107466#p107466" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Gui, +hwndhGui
Gui, Show, w300 h300

Sleep 1000

DeleteBorder(hGui)
Return

DeleteBorder(hwnd)  {
   static GWL_STYLE := -16, GWL_EXSTYLE := -20, WS_CAPTION := 0xC00000, WS_THICKFRAME := 0x40000
        , WS_MINIMIZE := 0x20000000, WS_MAXIMIZE := 0x1000000, WS_SYSMENU := 0x80000
        , WS_EX_DLGMODALFRAME := 0x1, WS_EX_CLIENTEDGE := 0x200, WS_EX_STATICEDGE := 0x20000
   
   lStyle := DllCall(&quot;GetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_STYLE, Ptr)
   lExStyle := DllCall(&quot;GetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_EXSTYLE, Ptr)
   
   lStyle &amp;= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU)
   lExStyle &amp;= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE)
   
   DllCall(&quot;SetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_STYLE, Ptr, lStyle)
   DllCall(&quot;SetWindowLongPtr&quot;, Ptr, hwnd, Int, GWL_EXSTYLE, Ptr, lExStyle)
   
   WinSet, Redraw,, ahk_id %hwnd%
}</code></pre></div><p>Но на самом деле никакой альтернативы WinSet нет, она использует тот же механизм, все эти стили можно было бы и с помощью WinSet изменить.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-09-10T15:51:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107466#p107466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107465#p107465" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, пробовал - не помогает. И по названию и по процессу и по ahk_class.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2016-09-10T13:41:23Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107465#p107465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107464#p107464" />
			<content type="html"><![CDATA[<p><strong>kharlashkin</strong>, <a href="http://forum.script-coding.com/viewtopic.php?id=9590">не нужно</a> цитировать предыдущий пост. Для начала стоит попробовать обращаться к окну не по ahk_exe, а по названию и/или ahk_class.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-09-10T13:37:48Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107464#p107464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107459#p107459" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Игры используют нестандартные окна, рамки могут быть просто нарисованными.</p></blockquote></div><p>Да нет, вроде стандартное Windows окно, дело в том что в зависимости от &quot;фазы луны&quot; срабатывает и приведенный код. Вот ищу способ попробовать через DllCall, нашел пример на <a href="http://stackoverflow.com/questions/2398746/removing-window-border">C/C++</a>. Может кто подскажет как его применить в AHK</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2016-09-10T05:20:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107459#p107459</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107458#p107458" />
			<content type="html"><![CDATA[<p>Игры используют нестандартные окна, рамки могут быть просто нарисованными.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-09-10T05:02:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107458#p107458</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Альтернатива WinSet]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=107456#p107456" />
			<content type="html"><![CDATA[<p>Добрый день!</p><p>Интересует альтернативное убирание рамок окна, при использовании:<br /></p><div class="codebox"><pre><code>WinSet, Style, -0xC40000, ahk_exe myGame.exe</code></pre></div><p>Рамки не убираются. Ткните в пример через DllCall.</p>]]></content>
			<author>
				<name><![CDATA[kharlashkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32183</uri>
			</author>
			<updated>2016-09-10T04:41:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=107456#p107456</id>
		</entry>
</feed>
