<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Проверка орфографии в Skype]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7216</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7216&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Проверка орфографии в Skype».]]></description>
		<lastBuildDate>Wed, 30 May 2012 15:55:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60582#p60582</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 30 May 2012 15:55:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60582#p60582</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60580#p60580</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Wed, 30 May 2012 15:31:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60580#p60580</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60578#p60578</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (kirtech)]]></author>
			<pubDate>Wed, 30 May 2012 13:14:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60578#p60578</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60575#p60575</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 30 May 2012 12:31:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60575#p60575</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Проверка орфографии в Skype]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60570#p60570</link>
			<description><![CDATA[<p>Пожалуйста, помогите разобраться.</p>]]></description>
			<author><![CDATA[null@example.com (Kialtor)]]></author>
			<pubDate>Wed, 30 May 2012 08:44:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60570#p60570</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Проверка орфографии в Skype]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60323#p60323</link>
			<description><![CDATA[<p>Добрый день. <br />Помогите, пожалуйста, со скриптом.<br />Надо, чтобы при появлении в фокусе любого чата Skype (или при mouse1 на нем), скрипт посылал сочетание клавиш в это окно. Например, F7.<br />Для Скайпа есть замечательный бесплатный спелчекер <a href="http://ursa-spelling.com/">Ursa Speller</a>, но в нем не реализован автозапуск, надо в каждом окне включать его ручками.<br />Заранее спасибо</p>]]></description>
			<author><![CDATA[null@example.com (Kialtor)]]></author>
			<pubDate>Mon, 14 May 2012 14:15:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60323#p60323</guid>
		</item>
	</channel>
</rss>
