<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Поверх всех окон в Windows 10]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=17660&amp;type=atom" />
	<updated>2023-03-12T02:48:57Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=17660</id>
		<entry>
			<title type="html"><![CDATA[AHK: Поверх всех окон в Windows 10]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157097#p157097" />
			<content type="html"><![CDATA[<p>Недокументированная CreateWindowInBand.<br /></p><div class="quotebox"><blockquote><p>CreateWindowInBand<br />This is a private api function found in user32.dll.<br />CreateWindowInBand function is the same as CreateWindowEx except it has 1 more parameter, dwBand, that is where you specify the band on which the window should stay (ZBID).</p><p>HWND WINAPI CreateWindowInBand(<br />DWORD dwExStyle,<br />LPCWSTR lpClassName,<br />LPCWSTR lpWindowName,<br />DWORD dwStyle,<br />int x,<br />int y,<br />int nWidth,<br />int nHeight,<br />HWND hWndParent,<br />HMENU hMenu,<br />HINSTANCE hInstance,<br />LPVOID lpParam,<br />DWORD dwBand);</p></blockquote></div><p><a href="https://blog.adeltax.com/window-z-order-in-windows-10/">https://blog.adeltax.com/window-z-order-in-windows-10/</a></p><p>Скрипт надо запускать с Run with UI Access:<br /></p><div class="codebox"><pre><code>#persistent
hwnd := DllCall(&quot;CreateWindowInBand&quot;, &quot;uint&quot;, 0, &quot;str&quot;, &quot;Autohotkey&quot;, &quot;str&quot;, &quot;title&quot;, &quot;uint&quot;, 0, &quot;int&quot;, 0, &quot;int&quot;, 0, &quot;int&quot;, 200, &quot;int&quot;, 200, &quot;ptr&quot;, 0, &quot;ptr&quot;, 0, &quot;ptr&quot;, 0, &quot;ptr&quot;, 0, &quot;int&quot;, ZBID_UIACCESS := 2, &quot;ptr&quot;)
if !a_lasterror
   WinShow ahk_id %hwnd%
else 
   msgbox % a_lasterror</code></pre></div><p><strong>teadrinker</strong> определил, что при запуске скрипта через UI ACCESS, опция +AlwaysOnTop&nbsp; устанавливает на гуи ZBID_UIACCESS. <br /></p><div class="codebox"><pre><code>If !RegExMatch(DllCall(&quot;GetCommandLine&quot;, &quot;Str&quot;), &quot; /restart(?!\S)&quot;)
{
   If (A_PtrSize = 8)
      RunWait &quot;C:\Program Files\AutoHotkey\AutoHotkeyU64_UIA.exe&quot; /restart &quot;%A_ScriptFullPath%&quot;
   Else If A_IsUnicode
      RunWait &quot;C:\Program Files\AutoHotkey\AutoHotkeyU32_UIA.exe&quot; /restart &quot;%A_ScriptFullPath%&quot;
   Else
      RunWait &quot;C:\Program Files\AutoHotkey\AutoHotkeyA32_UIA.exe&quot; /restart &quot;%A_ScriptFullPath%&quot;
}
Gui, +HWNDhGui
Gui, Add, Text,, Please enter your name:
Gui, Add, Edit, vName hwndhEdit
Gui, Show, x0 y0
DllCall(&quot;GetWindowBand&quot;, &quot;ptr&quot;, hGui, &quot;uint*&quot;, band)
msgbox % band
Gui, +AlwaysOnTop
DllCall(&quot;GetWindowBand&quot;, &quot;ptr&quot;, hGui, &quot;uint*&quot;, band)
msgbox % band</code></pre></div><p><a href="http://forum.script-coding.com/viewtopic.php?id=15348">Тема для обсуждения</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2023-03-12T02:48:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157097#p157097</id>
		</entry>
</feed>
