<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JScript: получение заголовка окна по его классу]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=612&amp;type=atom" />
	<updated>2007-08-21T06:46:30Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=612</id>
		<entry>
			<title type="html"><![CDATA[JScript: получение заголовка окна по его классу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=4139#p4139" />
			<content type="html"><![CDATA[<p>Автор примера - <strong>YMP</strong>.<br />Потребуется библиотека <a href="http://www.script-coding.com/dynwrap.html">dynwrap</a>.<br /></p><div class="codebox"><pre><code>wndclass=&quot;Notepad&quot;;
sh=new ActiveXObject(&quot;WScript.Shell&quot;);
wrap=new ActiveXObject(&quot;DynamicWrapper&quot;);

for(n=1024, title=&quot;&quot;; n&gt;0; n--) title+=&quot; &quot;;

wrap.Register(&quot;User32.dll&quot;, &quot;FindWindow&quot;, &quot;i=su&quot;, &quot;f=s&quot;, &quot;r=h&quot;);
wrap.Register(&quot;User32.dll&quot;, &quot;GetWindowTextW&quot;, &quot;i=hwl&quot;, &quot;f=s&quot;, &quot;r=l&quot;);

if(!(hwnd=wrap.FindWindow(wndclass, 0)))
  sh.Popup(&quot;Окон не найдено&quot;);
else {
  wrap.GetWindowTextW(hwnd, title, 1024);
  sh.Popup(title, 0, &quot;Заголовок окна&quot;);
}</code></pre></div><p>Класс нужного окна можно выяснить с помощью утилиты AU3_Spy.exe из <a href="http://www.autohotkey.com/download/">поставки AutoHotkey</a> (качать zip-вариант, экзешник просто взять оттуда). Более новый и русифицированный вариант этой же утилиты: <a href="http://forum.script-coding.com/viewtopic.php?id=57">AutoHotkey: дополнения к AU3_Spy (инструменты информации об окнах)</a>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2007-08-21T06:46:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=4139#p4139</id>
		</entry>
</feed>
