<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Дезактивация работы скрипта в поле своего окна]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9274&amp;type=atom" />
	<updated>2017-08-24T20:00:39Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9274</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118765#p118765" />
			<content type="html"><![CDATA[<p>Да, действительно, так оно и есть.<br />Тогда на этот случай надо еще, как писал <strong>stealzy</strong> проверять состояние окна.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-24T20:00:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118765#p118765</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118764#p118764" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>нажимаешь {LAlt Down}{Escape}{LAlt Up}</p></blockquote></div><p>Окно должно деактивироватся.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-24T19:53:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118764#p118764</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118760#p118760" />
			<content type="html"><![CDATA[<p>Сворачиваешь <span class="bbu">несколько</span> окон, ативируешь одно из них, нажимаешь {LAlt Down}{Escape}{LAlt Up}, смотришь хэндл, нажимаешь {LWin Down}{Up}{LWin Up}, смотришь хэндл. Хэндлы одинаковые.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-24T19:36:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118760#p118760</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118759#p118759" />
			<content type="html"><![CDATA[<p>У меня твой код открывает блокнот, потом показываеи его хендл, потом максимизирует.<br />Проверь с помощью 17 кода хендлы разные или нет.<br />Если разные, то и окна разные.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-24T19:32:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118759#p118759</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118753#p118753" />
			<content type="html"><![CDATA[<p>Показывает что окно хоть и свёрнуто но считается активным, ввод {LWin Down}{Up}{LWin Up} идёт опять же в это окно.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-24T19:15:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118753#p118753</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118752#p118752" />
			<content type="html"><![CDATA[<p>Я не совсем понимаю, что твой код показывает.<br />Я проверял так:<br />Нажимал f11 при развернутой программе, потом сворачивал и нажимал снова.<br />Результат был постоянно разным.<br /></p><div class="codebox"><pre><code>f11::
WinGet, t ,id, A
tooltip %t%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-24T19:10:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118752#p118752</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118750#p118750" />
			<content type="html"><![CDATA[<p>Как другое, если WinGet, h ,id, A возвращает хэндл окна.<br /></p><div class="codebox"><pre><code>WinMinimizeAll
run notepad
Sleep 2222
Send {LAlt Down}{Escape}{LAlt Up}
Sleep 1111
Wingettitle t, A
WinGetclass,c, A
WinGet, h ,id, A
tooltip % t &quot;`n&quot; c &quot;`n&quot; h
Sleep 1111
Send {LWin Down}{Up}{LWin Up}
Sleep 1111
Wingettitle t, A
WinGetclass,c, A
WinGet, h ,id, A
tooltip % t &quot;`n&quot; c &quot;`n&quot; h
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-24T19:04:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118750#p118750</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118749#p118749" />
			<content type="html"><![CDATA[<p>Я имел в виду, то что при сворачивании окна активным становится другое окно - его иконка.<br /></p><div class="quotebox"><blockquote><p>For a typical application, the system draws an icon, called the class icon, when the window is minimized, labeling the icon with the name of the window. The class icon, a static image that represents the application, is specified by the application when it registers the window class. The application assigns a handle to the class icon to the hIcon member of WNDCLASS before calling RegisterClass. The application can use the LoadIcon function to retrieve the icon handle.</p></blockquote></div><p><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd145059(v=vs.85).aspx">https://msdn.microsoft.com/en-us/librar … s.85).aspx</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-24T19:02:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118749#p118749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118746#p118746" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Активным становится другое окно, просто название его не меняется, а хендл и класс да.</p></blockquote></div><p>Не до конца понял, ты утверждаешь что свёрнутое окно не может быть активным?<br /></p><div class="codebox"><pre><code>WinMinimizeAll
run notepad
Sleep 2222
Send {LAlt Down}{Escape}{LAlt Up}
Sleep 1111
Wingettitle t, A
WinGetclass,c, A
WinGet, h ,id, A
tooltip % t &quot;`n&quot; c &quot;`n&quot; h
Sleep 2222
Send {LWin Down}{Up}{LWin Up}
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-24T18:07:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118746#p118746</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118713#p118713" />
			<content type="html"><![CDATA[<p>Спасибо большое&nbsp; <strong>Malcev</strong> , то что нужно. Вот так это выглядит.<br /></p><div class="codebox"><pre><code>Gui, +hwndhGui +AlwaysOnTop -Caption +ToolWindow +LastFound
;WinGet, ID
;WinSet TransColor, EEAA99
;Gui, Color, EEAA99
gui, font, s12 
Gui, Add, Text , cFF8000 vStatic1 x0 y0, Ru
Gui, Add, Text , cFF8000 vStatic2 x0 y0, En

DetectHiddenWindows, on
loop
{
oldlang:=lang
   lang:=InputLayout()
if (oldlang!=lang)
   If (lang = &quot;Russian&quot;)
   {
GuiControl, hide, static2
    GuiControl, Show, static1 
}
   Else If (lang = &quot;English&quot;)
   {
GuiControl, hide, static1
      GuiControl, Show, static2
}
   IfWinActive ahk_class Chrome_WidgetWin_1
      Gui, Show, x95 y39 w20 h20 NA, lang053
   else
Gui Submit, Hide
    ;  WinHide lang053 
   sleep, 50
}


InputLayout()
{
    WinGetClass, Class, % &quot;ahk_id&quot; hID := WinExist(&quot;A&quot;)
     if !id := DllCall(&quot;GetWindow&quot;, Ptr, hid, UInt, GW_OWNER := 4, Ptr)
      id:=hID
    ThreadID := DllCall(&quot;GetWindowThreadProcessId&quot;, &quot;Int&quot;, id, &quot;Int&quot;, 0)
    HKL := DllCall(&quot;GetKeyboardLayout&quot;, &quot;uint&quot;, ThreadID, &quot;UShort&quot;)
    VarSetCapacity(sKbd, 260, 0)
    DllCall(&quot;GetLocaleInfo&quot;, &quot;uint&quot;, HKL
                           , &quot;uint&quot;, 0x1001
                           , &quot;str&quot;,  sKbd
                           , &quot;uint&quot;, 260)
    Return sKbd
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2017-08-23T20:54:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118713#p118713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118708#p118708" />
			<content type="html"><![CDATA[<p>Активным становится другое окно, просто название его не меняется, а хендл и класс да.<br /></p><div class="codebox"><pre><code>f11::
;  wingettitle t, A
  WinGetclass ,t, A
; WinGet, t ,id, A
  tooltip %t%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-23T19:36:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118708#p118708</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118701#p118701" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, взято из опыта, сам спотыкался, но сейчас проверил основательнее.<br />Если имеем на столе только одно несвернутое окно, то при его сворачивании оно может остаться активным, если есть тултип.<br />Иначе активной становится Start ahk_class Button.<br /></p><div class="codebox"><pre><code>loop {
  sleep 500
  wingettitle t, A
  tooltip % t
  ; outputdebug % t
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-08-23T18:32:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118701#p118701</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118670#p118670" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>stealzy пишет:</cite><blockquote><p>Окно остается активным при сворачивании.</p></blockquote></div><p>А разве такое возможно?<br /></p><div class="codebox"><pre><code>DetectHiddenWindows, on
loop
{
   IfWinActive ahk_class Chrome_WidgetWin_1
      tooltip active
   else
      tooltip noactive
   sleep, 50
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-08-23T09:59:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118670#p118670</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118665#p118665" />
			<content type="html"><![CDATA[<p>Почему неправильно? Окно остается активным при сворачивании.<br />Добавьте условие на состояние окна - WinGet State.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2017-08-23T03:29:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118665#p118665</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Дезактивация работы скрипта в поле своего окна]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118662#p118662" />
			<content type="html"><![CDATA[<p>Доброго времени суток. Сделал скрипт на индикацию раскладки клавиатуры. Нужно что бы он показывал раскладку клавиатуры только в &quot;Google Chrome&quot;. Использовал функцию (IfWinActive) , работает но как то неправильно . Окно &quot;Gui &quot; показывается только в &quot;Google Chrome&quot; , работает исправно но при сворачивании &quot;Google Chrome&quot; остаётся висеть на рабочем столе. Помогите исправить.<br /></p><div class="codebox"><pre><code>DetectHiddenWindows, on

Gui, +hwndhGui +AlwaysOnTop -Caption +ToolWindow +LastFound
;WinGet, ID
;WinSet TransColor, EEAA99
;Gui, Color, EEAA99
gui, font, s12 
Gui, Add, Text , cFF8000 vStatic1 x0 y0, Ru
Gui, Add, Text , cFF8000 vStatic2 x0 y0, En

loop

IfWinActive ahk_class Chrome_WidgetWin_1
{
oldlang:=lang
   lang:=InputLayout()
if (oldlang!=lang)
   If (lang = &quot;Russian&quot;)
   {
GuiControl, hide, static2
    GuiControl, Show, static1 
Gui, Show, x95 y39 w20 h20 NA, lang053
   }
   Else If (lang = &quot;English&quot;)
   {
GuiControl, hide, static1
      GuiControl, Show, static2
Gui, Show, x95 y39 w20 h20 NA, lang053
}
sleep, 50
}

InputLayout()
{
    WinGetClass, Class, % &quot;ahk_id&quot; hID := WinExist(&quot;A&quot;)
     if !id := DllCall(&quot;GetWindow&quot;, Ptr, hid, UInt, GW_OWNER := 4, Ptr)
      id:=hID
    ThreadID := DllCall(&quot;GetWindowThreadProcessId&quot;, &quot;Int&quot;, id, &quot;Int&quot;, 0)
    HKL := DllCall(&quot;GetKeyboardLayout&quot;, &quot;uint&quot;, ThreadID, &quot;UShort&quot;)
    VarSetCapacity(sKbd, 260, 0)
    DllCall(&quot;GetLocaleInfo&quot;, &quot;uint&quot;, HKL
                           , &quot;uint&quot;, 0x1001
                           , &quot;str&quot;,  sKbd
                           , &quot;uint&quot;, 260)
    Return sKbd
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Ядрён]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30092</uri>
			</author>
			<updated>2017-08-22T20:59:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118662#p118662</id>
		</entry>
</feed>
