<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16681</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16681&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: неправильно работает код при русской раскладке клавиатуры».]]></description>
		<lastBuildDate>Wed, 27 Oct 2021 10:17:19 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150229#p150229</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, работает, спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (CyberGudini)]]></author>
			<pubDate>Wed, 27 Oct 2021 10:17:19 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150229#p150229</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150228#p150228</link>
			<description><![CDATA[<p><strong>__Михаил__</strong> увы, не сработало</p>]]></description>
			<author><![CDATA[null@example.com (CyberGudini)]]></author>
			<pubDate>Wed, 27 Oct 2021 10:15:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150228#p150228</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150223#p150223</link>
			<description><![CDATA[<p>На первых порах можно использовать без понимания. Нужно только получать объект Excel.Application<br /></p><div class="codebox"><pre><code>Excel := Excel_Get()

Excel_Get(WinTitle := &quot;ahk_class XLMAIN&quot;) {
   ControlGet, hwnd, hwnd,, Excel71, %WinTitle%
   if !hwnd
      return
   Window := AccObjectFromWindow(hwnd, -16)
   Loop {
      try Application := Window.Application
      catch
         ControlSend, Excel71, {esc}, %WinTitle%
   } Until !!Application
   return Application
}

AccObjectFromWindow(hWnd, idObject = 0)
{
   static IID_IDispatch   := &quot;{00020400-0000-0000-C000-000000000046}&quot;
        , IID_IAccessible := &quot;{618736E0-3C3D-11CF-810C-00AA00389B71}&quot;
        , OBJID_NATIVEOM  := 0xFFFFFFF0, VT_DISPATCH := 9, F_OWNVALUE := 1
        , h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
        
   VarSetCapacity(IID, 16), idObject &amp;= 0xFFFFFFFF
   DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;Str&quot;, idObject = OBJID_NATIVEOM ? IID_IDispatch : IID_IAccessible, &quot;Ptr&quot;, &amp;IID)
   if DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject, &quot;Ptr&quot;, &amp;IID, &quot;PtrP&quot;, pAcc) = 0
      Return ComObjEnwrap(VT_DISPATCH, pAcc, F_OWNVALUE)
}</code></pre></div><p>и использовать его.<br />Ознакомьтесь, пожалуйста, с <a href="https://forum.script-coding.com/misc.php?action=rules">правилами</a>. Обратите внимание на <a href="https://forum.script-coding.com/misc.php?action=rules#literacy">точки</a> в конце предложений и правила <a href="https://forum.script-coding.com/misc.php?action=rules#quotation">цитирования</a>. Я отредактировал ваш пост.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 26 Oct 2021 21:43:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150223#p150223</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150222#p150222</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>По идее ^c должно работать, если у вас последняя версия AHK.</p></blockquote></div><p>Да, версия старая. Нужно чтобы работало именно на старой версии, с установкой новой версии почему-то возникают проблемы.</p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А вообще лучше так:</p></blockquote></div><p>Уххх, ну прям хардкор какой-то. Понять бы еще это. <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /><br />Завтра, как попробую - отпишусь.</p>]]></description>
			<author><![CDATA[null@example.com (CyberGudini)]]></author>
			<pubDate>Tue, 26 Oct 2021 21:34:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150222#p150222</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150220#p150220</link>
			<description><![CDATA[<p>А вообще лучше так:<br /></p><div class="codebox"><pre><code>MsgBox, % GetSelectedCellText()      

GetSelectedCellText() {
   if !IsObject( Excel := Excel_Get() ) {
      MsgBox, Failed to get Excel Application object!
      return
   }
   Return Excel.Selection.Cells[1].text
}

Excel_Get(WinTitle := &quot;ahk_class XLMAIN&quot;) {
   ControlGet, hwnd, hwnd,, Excel71, %WinTitle%
   if !hwnd
      return
   Window := AccObjectFromWindow(hwnd, -16)
   Loop {
      try Application := Window.Application
      catch
         ControlSend, Excel71, {esc}, %WinTitle%
   } Until !!Application
   return Application
}

AccObjectFromWindow(hWnd, idObject = 0)
{
   static IID_IDispatch   := &quot;{00020400-0000-0000-C000-000000000046}&quot;
        , IID_IAccessible := &quot;{618736E0-3C3D-11CF-810C-00AA00389B71}&quot;
        , OBJID_NATIVEOM  := 0xFFFFFFF0, VT_DISPATCH := 9, F_OWNVALUE := 1
        , h := DllCall(&quot;LoadLibrary&quot;, &quot;Str&quot;, &quot;oleacc&quot;, &quot;Ptr&quot;)
        
   VarSetCapacity(IID, 16), idObject &amp;= 0xFFFFFFFF
   DllCall(&quot;ole32\CLSIDFromString&quot;, &quot;Str&quot;, idObject = OBJID_NATIVEOM ? IID_IDispatch : IID_IAccessible, &quot;Ptr&quot;, &amp;IID)
   if DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject, &quot;Ptr&quot;, &amp;IID, &quot;PtrP&quot;, pAcc) = 0
      Return ComObjEnwrap(VT_DISPATCH, pAcc, F_OWNVALUE)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 26 Oct 2021 21:16:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150220#p150220</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150218#p150218</link>
			<description><![CDATA[<p>По идее ^c должно работать, если у вас последняя версия AHK.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 26 Oct 2021 21:01:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150218#p150218</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150217#p150217</link>
			<description><![CDATA[<p><strong>__Михаил__</strong> попробую, завтра напишу по результатам.<br />Я еще нашел такой вариант: <br /></p><div class="codebox"><pre><code>Send ^{vk43}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (CyberGudini)]]></author>
			<pubDate>Tue, 26 Oct 2021 20:21:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150217#p150217</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150216#p150216</link>
			<description><![CDATA[<p>Попробуйте так:<br /></p><div class="codebox"><pre><code>Send, ^{c}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Tue, 26 Oct 2021 18:01:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150216#p150216</guid>
		</item>
		<item>
			<title><![CDATA[AHK: неправильно работает код при русской раскладке клавиатуры]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=150215#p150215</link>
			<description><![CDATA[<p>Задача скопировать в буфер выделенную мышкой ячейку в excel. При англ. раскладке все отлично. Но при русской - сочетание alt+x срабатывает, однако скрипт вводит в ячейку символ &#039;c&#039; и неудачно её копирует (ErrorLevel). <br />Как исправить? <br />Код:<br /></p><div class="codebox"><pre><code>
!x::
	kd1 := &quot;&quot;
	Clipboard =         ;Сделать Буфер обмена пустым
	Send, ^c
	ClipWait, 2
	if ErrorLevel &lt;&gt; 0
	{
		MsgBox, Попытка скопировать текст в буфер обмена неудачна.
		Return
	}
	
	cl = %clipboard%
return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (CyberGudini)]]></author>
			<pubDate>Tue, 26 Oct 2021 17:55:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=150215#p150215</guid>
		</item>
	</channel>
</rss>
