<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Shell.Application - не видит окно]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=16604&amp;type=atom" />
	<updated>2023-05-16T07:17:43Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=16604</id>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=158248#p158248" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>    (new ActiveXObject(&quot;WScript.Shell&quot;)).Run(&quot;mshta.exe javascript:&quot;+CodeForLinking);
    while (NumberOfWindows==ShellWindows.Count) {WScript.Sleep(10);}

    for (var i=ShellWindows.Count; --i&gt;=0;)
    try
    {
       if  (ShellWindows.Item(i).id == ID) 
       window = ShellWindows.Item(i).parent.parentWindow;
    } catch (e) {}</code></pre></div><p>А есть более надёжный метод? <br />Надо создать окно проводника, но в цикле проверять что количество окон изменилось как то не правильно.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2023-05-16T07:17:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=158248#p158248</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149738#p149738" />
			<content type="html"><![CDATA[<p><strong>fkhlamingo</strong>, тогда я бы посоветовал ещё и <a href="https://github.com/diqipib/WSH-Worker-streams">https://github.com/diqipib/WSH-Worker-streams</a><br />Там передача делается через NTFS стримы.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2021-09-25T09:54:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149738#p149738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149736#p149736" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Xameleon пишет:</cite><blockquote><p>Вы хотите передавать данные между процессами ?</p></blockquote></div><p>Совершенно верно!</p>]]></content>
			<author>
				<name><![CDATA[fkhlamingo]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42005</uri>
			</author>
			<updated>2021-09-25T09:51:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149736#p149736</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149734#p149734" />
			<content type="html"><![CDATA[<p><strong>fkhlamingo</strong>, теперь второй вопрос. Вы хотите создать окно или передавать данные между процессами ? Поясню свой вопрос - и для первого и для второго используется технология связывания двух процессов через <strong>Shell.Application</strong>. Я пока из заголовка вашей темы не понял какая конечная цель.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2021-09-25T09:48:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149734#p149734</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149721#p149721" />
			<content type="html"><![CDATA[<p>Да, извините путаница вышла, мне надо написать на JScript, запускал на JScript по ссылке в 3-ем посте, потом пробовал на AHK (он для меня привычнее) так в тему и выложил.</p>]]></content>
			<author>
				<name><![CDATA[fkhlamingo]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42005</uri>
			</author>
			<updated>2021-09-25T07:40:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149721#p149721</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149697#p149697" />
			<content type="html"><![CDATA[<p><strong>fkhlamingo</strong>, по ссылке в 3-ем посте находятся примеры кода на <strong>JScript</strong> и <strong>VBScript</strong>. Вы в своём первом сообщении привели строки на <strong>AHK</strong>. Давайте всё же определимся на каком языке вы собираетесь писать код.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2021-09-24T19:55:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149697#p149697</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149678#p149678" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Xameleon пишет:</cite><blockquote><p>2) покажите, пожалуйста, код где выполняете:</p></blockquote></div><p>Один в один что по ссылке в 3 посте. Все варианты пробовал из той темы. У кого всё норм с первого раза, у кого как и у меня, ничего с разными вариациями. <br />Разные ОС и битности в выборке юзеров и.т.д. Я нуб, остальные ещё глубже в танке. Глубина в танке не влияет на результат, или работает сразу, или никак.</p>]]></content>
			<author>
				<name><![CDATA[fkhlamingo]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42005</uri>
			</author>
			<updated>2021-09-24T16:41:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149678#p149678</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149658#p149658" />
			<content type="html"><![CDATA[<p><strong>fkhlamingo</strong>, <br />1) </p><div class="quotebox"><blockquote><p>То есть я всё правильно понимаю - в коде из 1 поста окно должно добавляться?</p></blockquote></div><p>Если речь про ваше первое сообщение, то - нет.</p><p>2) покажите, пожалуйста, код где выполняете:<br /></p><div class="quotebox"><blockquote><p>RegisterAsBrowser в True</p></blockquote></div><p>3) </p><div class="quotebox"><blockquote><p>И как метод Register применить в JScript, я не нашёл примеров.</p></blockquote></div><p>Из JScript с ним работать проблематично, так как получить plCookie по ссылке нативными средствами языка нет возможности.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2021-09-23T19:23:31Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149658#p149658</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149653#p149653" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Мальчик-гей пишет:</cite><blockquote><p>RegisterAsBrowser в True</p></blockquote></div><p>Запускал, не помогло.</p>]]></content>
			<author>
				<name><![CDATA[fkhlamingo]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42005</uri>
			</author>
			<updated>2021-09-23T12:12:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149653#p149653</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149652#p149652" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Xameleon пишет:</cite><blockquote><p>P.S Не уверен, что есть необходимость в использовании этого метода, но всё возможно.</p></blockquote></div><p>То есть я всё правильно понимаю - в коде из 1 поста окно должно добавляться?<br />И как метод Register применить в JScript, я не нашёл примеров.</p>]]></content>
			<author>
				<name><![CDATA[fkhlamingo]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42005</uri>
			</author>
			<updated>2021-09-23T12:08:03Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149652#p149652</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149634#p149634" />
			<content type="html"><![CDATA[<p>Доброго вечера, коллеги. </p><p><strong>Мальчик-гей</strong>, по поводу метода <strong>Register</strong>: <a href="https://docs.microsoft.com/ru-ru/windows/win32/api/exdisp/nf-exdisp-ishellwindows-register">описание</a>.</p><div class="codebox"><pre><code>HRESULT Register(
  IDispatch *pid,
  long      hwnd,
  int       swClass,
  long      *plCookie
);</code></pre></div><div class="quotebox"><blockquote><p><strong>pid</strong></p><p>Type: IDispatch*</p><p>The window&#039;s IDispatch interface.</p><p><strong>hwnd</strong></p><p>Type: long</p><p>A handle that specifies the window to register.</p><p><strong>swClass</strong></p><p>Type: int</p><p>A member of ShellWindowTypeConstants that specifies the type of window.</p><p><strong>plCookie</strong></p><p>Type: long*</p><p>The window&#039;s cookie.</p></blockquote></div><p>В <strong>pid</strong> передаётся не хэндл, а ссылка на <strong>IDispatch</strong> интерфейс. В нашем случае ссылка на созданный <strong>ShellWindow</strong> или <strong>WebBrowser</strong>. Далее идёт hWnd окна,&nbsp; потом <a href="https://docs.microsoft.com/en-us/windows/win32/api/exdisp/ne-exdisp-shellwindowtypeconstants">класс окна</a> и наружу в параметр <strong>plCookie</strong> возвращается уникальный идентификатор окна.</p><p>P.S Не уверен, что есть необходимость в использовании этого метода, но всё возможно.</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2021-09-22T17:59:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149634#p149634</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149628#p149628" />
			<content type="html"><![CDATA[<p><strong>fkhlamingo</strong>, обратите внимание на сообщение 2010-12-11 12:47:47 в упомянутой вами теме:<br /></p><div class="quotebox"><cite>Xameleon пишет:</cite><blockquote><p>Дополню немного. Объект <strong>WebBrowser</strong> регистрируется в глобальной коллекции <strong>ShellWindows</strong> при установке его свойства <strong>RegisterAsBrowser</strong> в True. Благодаря этому можно из внешнего приложения его найти.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Мальчик-гей]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=30832</uri>
			</author>
			<updated>2021-09-21T21:54:10Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149628#p149628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149627#p149627" />
			<content type="html"><![CDATA[<p>Ну, если <strong>JSmаn</strong> тут появится, может разъяснит ситуацию.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-09-21T18:58:58Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149627#p149627</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149626#p149626" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Что именно?</p></blockquote></div><p>У кого то окно добавляется в Shell.Application сразу после запуска.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>По этому поводу вот тут:</p></blockquote></div><p>Спасибо! <br />Пробую Register, выдаёт несовпадение типов.<br /></p><div class="codebox"><pre><code>
MsgBox % ComObjCreate(&quot;Shell.Application&quot;).Windows.Count

MsgBox % ComObjCreate(&quot;WScript.Shell&quot;).Exec(&quot;mshta javascript:&quot;)
Clipboard := хэндл окна
MsgBox % ComObjCreate(&quot;Shell.Application&quot;).Windows.Register(Clipboard, 1)
ComObjCreate(&quot;Shell.Application&quot;).Windows
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[fkhlamingo]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=42005</uri>
			</author>
			<updated>2021-09-21T18:53:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149626#p149626</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Shell.Application - не видит окно]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=149625#p149625" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>fkhlamingo пишет:</cite><blockquote><p>Оно у кого работает, у кого нет.</p></blockquote></div><p>Что именно?<br /></p><div class="quotebox"><cite>fkhlamingo пишет:</cite><blockquote><p>WScript.Shell добавляет процесс в коллекцию Shell</p></blockquote></div><p>Тоже не очень понял, что вы имеете в виду.<br /></p><div class="quotebox"><cite>fkhlamingo пишет:</cite><blockquote><p>если его окно является webbrouser, то оно должно быть в Shell.Application.</p></blockquote></div><p>По этому поводу <a href="https://docs.microsoft.com/en-us/windows/win32/api/exdisp/nn-exdisp-ishellwindows#remarks">вот тут</a>:<br /></p><div class="quotebox"><cite>MSDN пишет:</cite><blockquote><p>The Shell windows collection includes file explorer windows and web browser windows Internet Explorer and 3rd-party web browsers.</p></blockquote></div><p>Насколько я понял код, там возникает какое-то временное окно, которое и является частью коллекции Shell windows.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-09-21T18:25:31Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=149625#p149625</id>
		</entry>
</feed>
