<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Проверка орфографии в Skype]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7216&amp;type=atom" />
	<updated>2012-05-30T15:55:03Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7216</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=60582#p60582" />
			<content type="html"><![CDATA[<p>Тогда уж до кучи:<br /></p><div class="codebox"><pre><code>#Persistent
EVENT_OBJECT_FOCUS := 0x8005

HookProcAdr := RegisterCallback(&quot;HookProc&quot;, &quot;F&quot;)
DllCall(&quot;SetWinEventHook&quot; , UInt, EVENT_OBJECT_FOCUS, UInt, EVENT_OBJECT_FOCUS, UInt, 0
                          , Ptr, HookProcAdr, UInt, 0, UInt, 0, UInt, 0)
return

HookProc(hWinEventHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime)
{
   WinGet, ProcessName, ProcessName, A
   if ProcessName not contains Skype
      return
   
   WinGetClass, Class, ahk_id %hwnd%
   if Class contains Chat
      Send, {F7}   ; здесь прописать нужные клавиши
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-05-30T15:55:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=60582#p60582</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=60580#p60580" />
			<content type="html"><![CDATA[<p>Замечательные примеры. Добавлю свои пять копеек, дабы превентивно&nbsp; подсказать ТС «в каком направлении копать, если что-то непонятно».<br /></p><div class="quotebox"><blockquote><p>Надо, чтобы при появлении в фокусе любого чата Skype […] скрипт [перечисление требуемых операций]</p></blockquote></div><p>В сообщениях выше — два варианта исполнения условия задачи.<br />Первый подразумевает ожидание, когда активное окно перестанет быть таковым, второй — реагирование на событие изменения активного окна.</p><p>Ниже — упрощенный вариант второго примера, разбавленный комментариями.<br /></p><div class="codebox"><pre><code>
DllCall(&quot;RegisterShellHookWindow&quot;, &quot;uint&quot;, A_ScriptHwnd)        ; 1) Регистрируем скрытое окно скрипта в качестве «получателя уведомления об изменении активного окна»
MsgNum := DllCall(&quot;RegisterWindowMessage&quot;, &quot;str&quot;, &quot;SHELLHOOK&quot;)
OnMessage(MsgNum, &quot;WindowActivated&quot;)                            ; 2) При получении сообщения о событии будет выполняться функция с именем WindowActivated…
OnExit, Esc
return

WindowActivated(wParam, lParam)                                 ; 3) …в которую будут переданы два параметра…
{
    global activatedWindowHwnd  ; Глобальная переменная сохраняющая значение id окна для отображения в TrayTip
    if (wParam = 4)                                             ; 4) …первый из них содержит «тип события»…
    {
        activatedWindowHwnd := lParam                           ; 5) …второй — Id окна, которое в данном случае (wParam=4) стало активным
        SetTimer, TrayTip, -250 ; Таймер запускает действия выполняемые от метки до return в отдельном псевдопотоке.
    }
}

TrayTip:
    TrayTip,, %activatedWindowHwnd% ; traytip для демонстрации, что вариант всё-ещё работает
    return

Esc::
    DllCall(&quot;DeregisterShellHookWindow&quot;, &quot;uint&quot;, A_ScriptHwnd) ; действие очевидно из имени функции.
    ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-05-30T15:31:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=60580#p60580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=60578#p60578" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Global hMsgWnd,WndClass:=&quot;TConversationForm.UnicodeClass&quot;,Wnd:=WndClass,CtrlClass:=&quot;TChatRichEdit.UnicodeClass1&quot;
Gui, +HwndhMsgWnd
DllCall(&quot;RegisterShellHookWindow&quot;,&quot;uint&quot;,hMsgWnd)
MsgNum:=DllCall(&quot;RegisterWindowMessage&quot;,&quot;str&quot;,&quot;SHELLHOOK&quot;)
OnMessage(MsgNum,&quot;ShellMessage&quot;)
Return

ShellMessage(wParam,lParam)
{
	Static HSHELL_WINDOWACTIVATED:=4
	If (wParam=HSHELL_WINDOWACTIVATED)
	{
		DllCall(&quot;GetClassName&quot;,&quot;uint&quot;,lParam,&quot;str&quot;,Wnd,&quot;int&quot;,31)
		if (Wnd=WndClass)
		SetTimer, CheckFocusedControl, -250
	}
}
  
CheckFocusedControl:
ControlGetFocus, Ctrl, ahk_class %WndClass%
if ErrorLevel=0
if (Ctrl=CtrlClass)
{
	ControlGet, CtrlHwnd,Hwnd,,%CtrlClass%, ahk_class %WndClass%
	if (CtrlHwnd&lt;&gt;LastCtrlHwnd)
	{
		Send,^{F7}
		TrayTip,,Проверка орфографии включена ; %LastCtrlHwnd%  %CtrlHwnd%
		LastCtrlHwnd:=CtrlHwnd
	}
}
return

Esc::
DllCall(&quot;DeregisterShellHookWindow&quot;,&quot;uint&quot;,hMsgWnd)
ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kirtech]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26525</uri>
			</author>
			<updated>2012-05-30T13:14:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=60578#p60578</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=60575#p60575" />
			<content type="html"><![CDATA[<p>Попробуй так:</p><div class="codebox"><pre><code>Chat := &quot;TChatRichEdit1&quot;   ; уточнить название контрола с чатом для своей версии Skype
WindowsWithChat := []

Loop
{
   ID := WinExist(&quot;A&quot;)
   WinWait, ahk_id %ID%
   WinGet, List, ControlList
   if List contains %Chat%
   {
      WinInList := &quot;&quot;
      for k,v in WindowsWithChat
         if (v = ID)
            WinInList := 1
         
      if !WinInList
      {
         WindowsWithChat.Insert(ID)
         ControlFocus, %Chat%
         SendInput, {F7}   ; здесь прописать нужные клавиши
      }
   }
   WinWaitNotActive
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-05-30T12:31:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=60575#p60575</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=60570#p60570" />
			<content type="html"><![CDATA[<p>Пожалуйста, помогите разобраться.</p>]]></content>
			<author>
				<name><![CDATA[Kialtor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24606</uri>
			</author>
			<updated>2012-05-30T08:44:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=60570#p60570</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Проверка орфографии в Skype]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=60323#p60323" />
			<content type="html"><![CDATA[<p>Добрый день. <br />Помогите, пожалуйста, со скриптом.<br />Надо, чтобы при появлении в фокусе любого чата Skype (или при mouse1 на нем), скрипт посылал сочетание клавиш в это окно. Например, F7.<br />Для Скайпа есть замечательный бесплатный спелчекер <a href="http://ursa-spelling.com/">Ursa Speller</a>, но в нем не реализован автозапуск, надо в каждом окне включать его ручками.<br />Заранее спасибо</p>]]></content>
			<author>
				<name><![CDATA[Kialtor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24606</uri>
			</author>
			<updated>2012-05-14T14:15:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=60323#p60323</id>
		</entry>
</feed>
