<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: AlwaysOnTop внутри Родителя]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10770</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10770&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: AlwaysOnTop внутри Родителя».]]></description>
		<lastBuildDate>Sun, 02 Aug 2015 18:45:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96187#p96187</link>
			<description><![CDATA[<p>Во, спасибо! Но кликом Edit не активируется. Если только через костыль ControlFocus - ControlClick, как вариант.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 02 Aug 2015 18:45:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96187#p96187</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96183#p96183</link>
			<description><![CDATA[<div class="codebox"><pre><code>Gui, +0x40000000 -0x80000000  ; Add WS_CHILD, remove WS_POPUP</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 02 Aug 2015 18:18:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96183#p96183</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96178#p96178</link>
			<description><![CDATA[<p>В первом примере контрол AutoHotkey принадлежит процессу родителя, видимо должен быть способ тоже самое сделать с окном...</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 02 Aug 2015 12:54:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96178#p96178</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=96174#p96174</link>
			<description><![CDATA[<p>В данном примере, активируя свой Edit, родительское окно не деактивируется:<br /></p><div class="codebox"><pre><code>
If !WinExist(&quot;ahk_class Notepad&quot;)  
{
    Run, Notepad,,, PID
    WinWait, ahk_pid %PID%
}
hNotepad := WinExist(&quot;ahk_class Notepad&quot;)
ControlGet, hEdit1, Hwnd, , Edit1, ahk_id %hNotepad% 
Gui, Add, Edit, w111 h111 x111 y111 HWNDh_Edit, Edit
DllCall(&quot;SetParent&quot;, &quot;uint&quot;, h_Edit, &quot;uint&quot;, hEdit1)   
WinActivate
Return
</code></pre></div><p>Возможно ли разместить в родителе своё окно, чтобы можно было им полноценно пользоватся, активировать, перемещать, изменять размер, вводить текст, но чтобы при этом не деактивировалось родительское?<br /></p><div class="codebox"><pre><code>
If !WinExist(&quot;ahk_class Notepad&quot;)  
{
    Run, Notepad,,, PID
    WinWait, ahk_pid %PID%
}
hNotepad := WinExist(&quot;ahk_class Notepad&quot;)
ControlGet, hEdit1, Hwnd, , Edit1, ahk_id %hNotepad%  
Gui, +AlwaysOnTop -DPIScale +HWNDhWin +ReSize
Gui, Add, Edit, w222 h222 x1 y1  
DllCall(&quot;SetParent&quot;, &quot;uint&quot;, hWin, &quot;uint&quot;, hEdit1)   
Gui, Show, na w222 h222 x111 y111, % &quot; &quot;
WinActivate 
Return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 01 Aug 2015 23:39:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=96174#p96174</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95283#p95283</link>
			<description><![CDATA[<p>В <a href="http://forum.script-coding.com/viewtopic.php?id=9163">этой теме</a> не созвучный вопрос поднимался?</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Sat, 11 Jul 2015 14:43:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95283#p95283</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95279#p95279</link>
			<description><![CDATA[<p>serzh82saratov, спасибо, уже буду думать как быть.</p>]]></description>
			<author><![CDATA[null@example.com (samardac)]]></author>
			<pubDate>Sat, 11 Jul 2015 13:34:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95279#p95279</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95277#p95277</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Проще сделать его <strong>как то</strong> прозрачным где надо.</p></blockquote></div><p>Не знаю как ещё.<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>
#SingleInstance Force      
#Persistent 
#NoEnv
ListLines Off  
DetectHiddenWindows, On
SetWinEventHook(0x8005, 0x8005, 0, RegisterCallback(&quot;MyFunc&quot;, &quot;F&quot;),0,0,0) ; EVENT_OBJECT_FOCUS 
SetWinEventHook(0x800B, 0x800B, 0, RegisterCallback(&quot;MyFunc&quot;, &quot;F&quot;),0,0,0) ; EVENT_OBJECT_LOCATIONCHANGE
Gui, Main: Color, EEAA99
Gui, Main: +HwndmainGuiId +LastFound  
Gui, Child2: Color, 198A05
Gui, Child2: +ParentMain +HwndchildGuiId2 +AlwaysOnTop 
Run, Notepad,, Hide
WinWait, ahk_class Notepad
Global External := WinExist(&quot;ahk_class Notepad&quot;), childGuiID2 
DllCall(&quot;SetParent&quot;, &quot;uint&quot;, External, &quot;uint&quot;, mainGuiId) 
WinMove, ahk_id %External%, , 110,110, 444, 444
WinShow, ahk_id %External%
Gui, Child2: Show, x222 y222 w200 h200, Child GUI 2
Gui, Main: Show, w600 h600 
WinSet, Top, , ahk_id %childGuiID2% 
 ; WinSet, ExStyle, +0x08000000, ahk_id %External%   ;  WS_EX_NOACTIVATE
WinSet, Region, 
(
0-0 200-0 200-200 0-200 0-0 
 50-50 80-50 80-80 50-80 50-50  
 100-100 100-180 180-180 150-180 150-150 
), ahk_id %childGuiID2%
WinSet, Redraw, , ahk_id %mainGuiId% 
WinSet, Redraw, , ahk_id %External% 
WinSet, Redraw, , ahk_id %childGuiID2%  
return

MyFunc(hWinEventHook, event, hwnd) { 
    If (hwnd = External) 
        WinSet, Top, , ahk_id %childGuiID2%   
}

SetWinEventHook(eventMin, eventMax, hmodWinEventProc, lpfnWinEventProc, idProcess, idThread, dwFlags)
{
   return DllCall(&quot;SetWinEventHook&quot; , UInt, eventMin, UInt, eventMax
                                    , Ptr, hmodWinEventProc, Ptr, lpfnWinEventProc
                                    , UInt, idProcess, UInt, idThread
                                    , UInt, dwFlags, Ptr)
}
</code></pre></div></div></div><p>Но с помощью WinSet, Region можно хоть картину пикассо обрисовать, при большом желании.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 11 Jul 2015 13:29:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95277#p95277</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95275#p95275</link>
			<description><![CDATA[<p>Вообще не думаю что WinSet, Region, подойдет, так как это окно Child2 будет полностью графическим и края его будут &quot;кучерявые&quot; а не просто окно - прямоугольник. И придется резать очень много и не просто регионом а полигонами. Проще сделать его как то прозрачным где надо.</p>]]></description>
			<author><![CDATA[null@example.com (samardac)]]></author>
			<pubDate>Sat, 11 Jul 2015 13:13:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95275#p95275</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95273#p95273</link>
			<description><![CDATA[<p>serzh82saratov, суть такая, есть:<br />1. Окно Child2, это окно которое всегда на верху. <br />2. Приложение(блокнот), которое находится под Child2<br />3. Родительсоке окно оно содержит в себе два предыдущих окна.</p><p>Child2, в некоторых местах должен быть прозрачным, что бы можно было&nbsp; взаимодействовать мышкой с приложение которое под ним.</p><p>WinSet, Region, позволит сделать много &quot;форточек&quot;? Так как там нужна не одна дырка.</p>]]></description>
			<author><![CDATA[null@example.com (samardac)]]></author>
			<pubDate>Sat, 11 Jul 2015 13:02:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95273#p95273</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95272#p95272</link>
			<description><![CDATA[<p>Не уверен что точно понял, может просто в нём сделать &quot;форточку&quot; с помощью WinSet, Region?</p><p>Никогда не пишите &quot;Untitled&quot; для блокнота.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 11 Jul 2015 12:59:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95272#p95272</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95270#p95270</link>
			<description><![CDATA[<p>serzh82saratov, появилась еще одна проблема она состоит в том что окно Child2 имеет прозрачные части сквозь которые можно взаимодействовать с неокоторыми частями приложения, но при этом методе скрипт номер1, если делаеш Child2 прозрачным припомощи WinSet, TransColor так он пробивает родительское окно на сквозь, в итоги ты видиш не приложение что подним, а то что под родительским окном.&nbsp; Есть ли како то вариант исправить это?<br />И еще, прозрачность окна Child2 работает только если она совпадает с прозрачность цвета Родительского окна.</p><div class="codebox"><pre><code>
DetectHiddenWindows, On
Gui, Main: Color, EEAA99
Gui, Main: +HwndmainGuiId  
Gui, Main: +LastFound  +resize
WinSet, TransColor, EEAA99
Gui, Main: Show, w600 h600


Gui, Child2: +ParentMain +HwndchildGuiId2 +AlwaysOnTop
Gui, Child2: Color, EEAA99
Gui, Child2: +LastFound 
WinSet, TransColor, EEAA99
Gui, Child2: Show, x100 y0 w300 h100, Child GUI 2

Run, Notepad,, Hide
WinWait, ahk_class Notepad
Global External := WinExist(&quot;Untitled&quot;), childGuiID2
DllCall(&quot;SetParent&quot;, &quot;uint&quot;, External, &quot;uint&quot;, mainGuiId) 
WinMove, ahk_id %External%, , 0,0 
WinShow, ahk_id %External%
WinSet, Top, , ahk_id %childGuiID2%
Gui, Main: Show
SetWinEventHook(0x8005, 0x8005, 0, RegisterCallback(&quot;MyFunc&quot;, &quot;F&quot;),0,0,0) 
; 0x8005 = EVENT_OBJECT_FOCUS  
return

MyFunc(hWinEventHook, event, hwnd) { 
    If (hwnd = External) 
        WinSet, Top, , ahk_id %childGuiID2%   
}

SetWinEventHook(eventMin, eventMax, hmodWinEventProc, lpfnWinEventProc, idProcess, idThread, dwFlags)
{
    return DllCall(&quot;SetWinEventHook&quot; , UInt, eventMin, UInt, eventMax
    , Ptr, hmodWinEventProc, Ptr, lpfnWinEventProc
    , UInt, idProcess, UInt, idThread
    , UInt, dwFlags, Ptr)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (samardac)]]></author>
			<pubDate>Sat, 11 Jul 2015 12:45:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95270#p95270</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95269#p95269</link>
			<description><![CDATA[<p>serzh82saratov, второй вариант вроде как дает похожий результат как и первый. Но я заметил что нотепад активируется только при клике по шапке, во всех других случаях он снизу. В моей задаче вместа нотепада будет другое приложение, и шапка этого приложения будет скрыта, так что активировать окно не получится я уже протестил с первым скриптом и все вроде как работает, приложение всегда снизу, спасибо! <br />Спасибо за идею с EventHook.</p>]]></description>
			<author><![CDATA[null@example.com (samardac)]]></author>
			<pubDate>Sat, 11 Jul 2015 12:32:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95269#p95269</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95267#p95267</link>
			<description><![CDATA[<p>Если в некоторых ситуациях всё таки будет уходить на задний план, то ещё по добавлять <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd318066(v=vs.85).aspx">сообщений WinEventHook</a>.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 11 Jul 2015 12:13:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95267#p95267</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95266#p95266</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>нотепад всерано активируется</p></blockquote></div><p>Ну он и должен активироватся, можно ещё попробовать добавить к нему стиль WS_EX_NOACTIVATE, но тогда скорее всего уже нельзя будет с ним взаимодействовать, и не всегда оно применяется.<br />Так ещё попробуйте:<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>
#SingleInstance Force      
#Persistent 
#NoEnv
ListLines Off  
DetectHiddenWindows, On
SetWinEventHook(0x8005, 0x8005, 0, RegisterCallback(&quot;MyFunc&quot;, &quot;F&quot;),0,0,0) ; EVENT_OBJECT_FOCUS 
SetWinEventHook(0x800B, 0x800B, 0, RegisterCallback(&quot;MyFunc&quot;, &quot;F&quot;),0,0,0) ; EVENT_OBJECT_LOCATIONCHANGE
Gui, Main: +HwndmainGuiId  
Gui, Main: +LastFound  
Gui, Child2: +ParentMain +HwndchildGuiId2 +AlwaysOnTop
Gui, Child2: Add, Text,,this is child gui 
Run, Notepad,, Hide
WinWait, ahk_class Notepad
Global External := WinExist(&quot;ahk_class Notepad&quot;), childGuiID2 
DllCall(&quot;SetParent&quot;, &quot;uint&quot;, External, &quot;uint&quot;, mainGuiId) 
WinMove, ahk_id %External%, , 0,0 
WinShow, ahk_id %External%
Gui, Child2: Show, x100 y0 w300 h100, Child GUI 2
Gui, Main: Show, w600 h150 
WinSet, Top, , ahk_id %childGuiID2% 
 ; WinSet, ExStyle, +0x08000000, ahk_id %External%   ;  WS_EX_NOACTIVATE
return

MyFunc(hWinEventHook, event, hwnd) { 
    If (hwnd = External) 
        WinSet, Top, , ahk_id %childGuiID2%   
}

SetWinEventHook(eventMin, eventMax, hmodWinEventProc, lpfnWinEventProc, idProcess, idThread, dwFlags)
{
   return DllCall(&quot;SetWinEventHook&quot; , UInt, eventMin, UInt, eventMax
                                    , Ptr, hmodWinEventProc, Ptr, lpfnWinEventProc
                                    , UInt, idProcess, UInt, idThread
                                    , UInt, dwFlags, Ptr)
}
</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 11 Jul 2015 12:06:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95266#p95266</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: AlwaysOnTop внутри Родителя]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=95264#p95264</link>
			<description><![CDATA[<p>teadrinker,<br />в двух словах, есть приложение поверх которого делается новый интерфэйс. Этот новый интерфэйс должен всегда лежать поверх приложения. Для облегчения манипуляции с этими двумя окнами они помещаются в родительское окно. </p><p>serzh82saratov, <br />нотепад всерано активируется и выходит на первый план.</p>]]></description>
			<author><![CDATA[null@example.com (samardac)]]></author>
			<pubDate>Sat, 11 Jul 2015 10:42:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=95264#p95264</guid>
		</item>
	</channel>
</rss>
