<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Узнать состояние системного меню/подменю]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11001&amp;type=atom" />
	<updated>2015-10-06T12:27:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11001</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97929#p97929" />
			<content type="html"><![CDATA[<p>Спасибо! Нет, это нужно, чтобы хоткей не работал в момент вызова разных меню.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-10-06T12:27:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97929#p97929</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97928#p97928" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>F11:: ToolTip % GetMenubarFocus(WinExist(&quot;A&quot;))

GetMenubarFocus(hwnd)
{
   static OBJID_MENU := 0xFFFFFFFD
   VarSetCapacity(MBI, size := 4*4 + A_PtrSize*4, 0)
   NumPut(size, MBI)
   DllCall(&quot;GetMenuBarInfo&quot;, Ptr, hwnd, Int, OBJID_MENU, Int, 0, Ptr, &amp;MBI)
   Return *(&amp;MBI + 4*4 + A_PtrSize*3) &amp; 1
}</code></pre></div><p>А зачем всё это нужно? Подозреваю, хотите запустить пункт меню путем отправки окну нажатий клавиш.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-06T12:08:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97928#p97928</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97921#p97921" />
			<content type="html"><![CDATA[<p>Всплыл ещё нюанс. А как выловить фокус на главном меню, если, к примеру, была нажата кл. Alt или свёрнуто подменю по Esc?</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-10-05T21:39:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97921#p97921</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97920#p97920" />
			<content type="html"><![CDATA[<p>Странно. FireFox 41.0.1. Работает, как часы.<br />Может какие-то плагины у тебя или у меня установлены.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-05T17:56:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97920#p97920</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97919#p97919" />
			<content type="html"><![CDATA[<p>У меня в хроме тоже работает в любой версии AHK код с хуком, в FF не работает ни какой вариант.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-05T17:46:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97919#p97919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97918#p97918" />
			<content type="html"><![CDATA[<p>У меня ahk 32 bit и в хроме работает и в фаерфоксе код из 11 поста.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-05T17:39:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97918#p97918</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97917#p97917" />
			<content type="html"><![CDATA[<p>Чего-то не пойму. Вроде заработал WinExist. Но я же с него начал проверять! Глюк был какой-то, похоже...</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-10-05T17:35:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97917#p97917</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97916#p97916" />
			<content type="html"><![CDATA[<p>У меня в факрфоксе никакой не работает, да и не должен, вроде.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-05T17:20:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97916#p97916</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97915#p97915" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Вообще-то у меня и так работает:<br /></p><div class="codebox"><pre><code>F11:: MsgBox, % WinExist(&quot;ahk_class #32768&quot;) ? 1 : 0</code></pre></div></blockquote></div><p>Так работает только со стандартным контекстным меню.<br />Код же из поста 11 работает везде.<br />В этом можно удостовериться, нажав правую кнопку мыши в окне фаерфокса.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-10-05T16:55:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97915#p97915</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97914#p97914" />
			<content type="html"><![CDATA[<p>Варианты из 2 и 13 сообщений работают на WinXP 32-bit.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2015-10-05T15:49:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97914#p97914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97911#p97911" />
			<content type="html"><![CDATA[<p>Ясно. У меня x32.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-10-05T15:33:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97911#p97911</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97910#p97910" />
			<content type="html"><![CDATA[<p>У меня семёрка как раз. Win 7 64, AHK x64.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-05T15:31:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97910#p97910</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97909#p97909" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, а на какой системе? На 7-ке не хочет.</p><br /><p><strong>yalanne</strong>, спасибо, но я предпочту вариант <strong>teadrinker</strong>, он компактнее. <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-10-05T15:24:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97909#p97909</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97908#p97908" />
			<content type="html"><![CDATA[<p>Если мой вариант пригодится с хоткеем то вот:</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;F11</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Persistent
DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;),

Acc_ObjectFromWindow(hWnd, idObject = 0)
{
    If DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject&amp;=0xFFFFFFFF, &quot;Ptr&quot;
    , -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81
    , NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,&quot;Int64&quot;),&quot;Int64&quot;), &quot;Ptr*&quot;, pacc)=0
    Return    ComObjEnwrap(9,pacc,1)
}

Acc_Parent(Acc) { 
    try parent:=Acc.accParent
    return parent?Acc_Query(parent):
}

Acc_Query(Acc) {
    try return ComObj(9, ComObjQuery(Acc,&quot;{618736e0-3c3d-11cf-810c-00aa00389b71}&quot;), 1)
}

F11::
if !(hWnd := WinExist(&quot;ahk_class #32768&quot;))
    return

Acc:=Acc_ObjectFromWindow(hWnd),    P := Acc.AccName(0)
        loop
            if ((Acc := Acc_Parent(Acc_Parent(Acc_Parent(Acc)))).AccRole(0)=9)
                P:= Acc.AccName(0) &quot;`n&quot; P
            Until (Acc.AccRole(0)=&quot;&quot;)
            
msgbox % P</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-10-05T15:08:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97908#p97908</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Узнать состояние системного меню/подменю]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97907#p97907" />
			<content type="html"><![CDATA[<p>Вообще-то у меня и так работает:<br /></p><div class="codebox"><pre><code>F11:: MsgBox, % WinExist(&quot;ahk_class #32768&quot;) ? 1 : 0</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-10-05T15:05:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97907#p97907</id>
		</entry>
</feed>
