<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Как сделать разделительную черту в Menu?]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16875</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16875&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Как сделать разделительную черту в Menu?».]]></description>
		<lastBuildDate>Wed, 28 Jun 2023 15:08:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158630#p158630</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Это мы с тобой кстати делали.</p></blockquote></div><p>Да? У меня не сохранилось. Но тут что-то лишнее, проще:<br /></p><div class="codebox"><pre><code>OnMessage(WM_DRAWITEM := 0x2B, &quot;WM_DRAWITEM&quot;)
Menu, MyMenu, Add, Item1, Handler
Menu, MyMenu, Add, Item2, Handler

VarSetCapacity(MENUITEMINFO, size := 16 + A_PtrSize * 8, 0)
NumPut(size, MENUITEMINFO)
NumPut(MIIM_TYPE := 0x10, MENUITEMINFO, 4)
NumPut(MFT_OWNERDRAW := 0x100, MENUITEMINFO, 8)

hMenu := MenuGetHandle(&quot;MyMenu&quot;)
DllCall(&quot;SetMenuItemInfo&quot;, &quot;Ptr&quot;, hMenu, &quot;UInt&quot;, 0, &quot;UInt&quot;, true, &quot;Ptr&quot;, &amp;MENUITEMINFO)

Gui, +HwndhGuiMenu

CoordMode, Mouse 
MouseGetPos, mX, mY 
DllCall(&quot;TrackPopupMenuEx&quot;, &quot;ptr&quot;, hMenu, &quot;uint&quot;, TPM_NONOTIFY := 0x0080, &quot;int&quot;, mX, &quot;int&quot;, mY, &quot;ptr&quot;, hGuiMenu, &quot;ptr&quot;, 0) 
Return	

Handler(item) {
   MsgBox, % item
}

WM_DRAWITEM(wp, lp, msg, hwnd) { 
   ToolTip   WM_DRAWITEM
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 28 Jun 2023 15:08:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158630#p158630</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158629#p158629</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>создаётся owner GUI</p></blockquote></div><p>Это мы с тобой кстати делали.<br /></p><div class="codebox"><pre><code>
OnMessage(WM_DRAWITEM := 0x2B, &quot;WM_DRAWITEM&quot;)
Menu, MyMenu, Add, Item1, Handler
Menu, MyMenu, Add, Item2, Handler


VarSetCapacity(MENUITEMINFO, size := 16 + A_PtrSize * 8, 0)
NumPut(size, MENUITEMINFO)
NumPut(MIIM_TYPE := 0x10, MENUITEMINFO, 4)
NumPut(MFT_OWNERDRAW := 0x100, MENUITEMINFO, 8)

DllCall(&quot;SetMenuItemInfo&quot;, &quot;Ptr&quot;, MenuGetHandle(&quot;MyMenu&quot;), &quot;UInt&quot;, 0, &quot;UInt&quot;, true, &quot;Ptr&quot;, &amp;MENUITEMINFO)

hMenu := MenuGetHandle(&quot;MyMenu&quot;)
PID := DllCall(&quot;GetCurrentProcessId&quot;)

WS_CLIPCHILDREN := 0x2000000
WS_POPUP := 0x80000000
WS_CHILD := 0x40000000


Gui, New 
Gui, +%WS_CHILD% -%WS_POPUP%
Gui, +HwndhGuiMenu -Caption


TPM_NONOTIFY := 0x0080
TPM_RIGHTBUTTON := 0x0002
flags := TPM_RIGHTBUTTON|TPM_NONOTIFY|0x0004

; 1:: 
	WinSet, Style, +%WS_CLIPCHILDREN%
	DllCall(&quot;SetParent&quot;, &quot;Ptr&quot;, hGuiMenu, &quot;Ptr&quot;, WinExist(&quot;A&quot;))
	CoordMode, Mouse 
	MouseGetPos, mX, mY 
	DllCall(&quot;TrackPopupMenuEx&quot;, &quot;ptr&quot;, hMenu, &quot;uint&quot;, flags, &quot;int&quot;, mx, &quot;int&quot;, my, &quot;ptr&quot;, hGuiMenu, &quot;ptr&quot;, 0) 
	Return	

Handler(item) {
   MsgBox, % item
}

WM_DRAWITEM(wp, lp, msg, hwnd) { 
   ToolTip   WM_DRAWITEM
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 28 Jun 2023 06:55:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158629#p158629</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158628#p158628</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Ага, интересно, посмотрел, как устроено. Там как раз создаётся owner GUI для меню.</p></blockquote></div><p>В код с #18 надо что то добавить?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 28 Jun 2023 06:44:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158628#p158628</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158627#p158627</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>На ahk есть попап библиотека:<br /><a href="https://www.autohotkey.com/board/topic/73599-ahk-l-pum-owner-drawn-object-based-popup-menu/">https://www.autohotkey.com/board/topic/ … opup-menu/</a></p></blockquote></div><p>А там ссылка на скачивание у всех рабочая? Я на гитхабе искал.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 28 Jun 2023 06:43:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158627#p158627</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158624#p158624</link>
			<description><![CDATA[<p>Ага, интересно, посмотрел, как устроено. Там как раз создаётся owner GUI для меню.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 27 Jun 2023 21:47:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158624#p158624</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158621#p158621</link>
			<description><![CDATA[<p>На ahk есть попап библиотека:<br /><a href="https://www.autohotkey.com/board/topic/73599-ahk-l-pum-owner-drawn-object-based-popup-menu/">https://www.autohotkey.com/board/topic/ … opup-menu/</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 27 Jun 2023 21:19:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158621#p158621</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158611#p158611</link>
			<description><![CDATA[<p>С popup пробовал, сообщение WM_DRAWITEM не приходит:<br /></p><div class="codebox"><pre><code>OnMessage(WM_DRAWITEM := 0x2B, &quot;WM_DRAWITEM&quot;)

Menu, MyMenu, Add, Item1, Handler
Menu, MyMenu, Add, Item2, Handler

VarSetCapacity(MENUITEMINFO, size := 16 + A_PtrSize * 8, 0)
NumPut(size, MENUITEMINFO)
NumPut(MIIM_TYPE := 0x10, MENUITEMINFO, 4)
NumPut(MFT_OWNERDRAW := 0x100, MENUITEMINFO, 8)

DllCall(&quot;SetMenuItemInfo&quot;, &quot;Ptr&quot;, MenuGetHandle(&quot;MyMenu&quot;), &quot;UInt&quot;, 0, &quot;UInt&quot;, true, &quot;Ptr&quot;, &amp;MENUITEMINFO)

Menu, MyMenu, Show

Handler(item) {
   MsgBox, % item
}

WM_DRAWITEM(wp, lp, msg, hwnd) {
   SoundBeep
}</code></pre></div><p>Через сабклассинг SetWindowLongPtr() тоже не работает.<br /><a href="https://learn.microsoft.com/en-us/windows/win32/menurc/using-menus#owner-drawn-menus-and-the-wm_drawitem-message">Owner-Drawn Menus and the WM_DRAWITEM Message</a><br /></p><div class="quotebox"><blockquote><p>Whenever the item must be drawn (for example, when it is first displayed or when the user selects it), the system sends the WM_DRAWITEM message to the window procedure of the menu&#039;s owner window.</p></blockquote></div><p>У popup меню нет owner window, по крайней мере в процессе AHK.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 27 Jun 2023 19:55:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158611#p158611</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158609#p158609</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Кстати старый уже вопрос, про изменить шрифт в меню...</p></blockquote></div><p>Если оконное меню, то как-то <a href="https://www.autoitscript.com/forum/topic/85532-can-i-change-the-menu-height-and-its-font/#comment-613715">так</a>. С popup-меню вроде не сработает.</p></blockquote></div><p>Эх, popup только нужно, и мне сложно будет переделать.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Tue, 27 Jun 2023 18:05:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158609#p158609</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158607#p158607</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Кстати старый уже вопрос, про изменить шрифт в меню...</p></blockquote></div><p>Если оконное меню, то как-то <a href="https://www.autoitscript.com/forum/topic/85532-can-i-change-the-menu-height-and-its-font/#comment-613715">так</a>. С popup-меню вроде не сработает.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 26 Jun 2023 19:14:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158607#p158607</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158605#p158605</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>При использовании иконок, размер можно указать штатно.</p></blockquote></div><p>Хотя, не совсем, расстояние между строками всё равно уменьшенное, в отличии когда без Break.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 26 Jun 2023 12:07:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158605#p158605</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158604#p158604</link>
			<description><![CDATA[<p>При использовании иконок, размер можно указать штатно.<br />Если иконок нет, то WM_MEASUREITEM я не понял, как его применить, хукать показ меню, и каждый и раз пересчитывать все пункты?<br />Кстати старый уже вопрос, про изменить шрифт в меню...</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 26 Jun 2023 11:58:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158604#p158604</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158602#p158602</link>
			<description><![CDATA[<p>О причине <strong>lexikos</strong> писал тут:<br /></p><div class="quotebox"><blockquote><p>Win32 menus are usually rendered by uxtheme.dll, but not if they use +Break or +BarBreak.</p></blockquote></div><p><a href="https://www.autohotkey.com/boards/viewtopic.php?t=73447">https://www.autohotkey.com/boards/viewtopic.php?t=73447</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 26 Jun 2023 11:09:23 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158602#p158602</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158601#p158601</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Странная штука, если в меню есть BarBreak:</p><p><span class="postimg"><img src="https://i.imgur.com/jurA8l6.png" alt="https://i.imgur.com/jurA8l6.png" /></span></p><p>То фон слева, под иконками, или без них, заполнен указанным цветом, если без BarBreak, то слева выглядит нехорошо:</p><p><span class="postimg"><img src="https://i.imgur.com/3OVWgBA.png" alt="https://i.imgur.com/3OVWgBA.png" /></span></p></blockquote></div><p>Кому интересно решение, для первого пункта надо добавить &quot;+Break&quot;, при этом меню становится компактнее по размерам.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 26 Jun 2023 10:26:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158601#p158601</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158600#p158600</link>
			<description><![CDATA[<p>Если ListView подходит, тогда нет проблем.<br /></p><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>А про что разговор?</p></blockquote></div><p>На html-css и с нуля несложно что-то наваять (если, конечно, навык есть). И поведение более тонко настороить.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 25 Jun 2023 20:40:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158600#p158600</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как сделать разделительную черту в Menu?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=158599#p158599</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Если имеешь в виду winapi, то на нём делать свой дизайн UI слишком заморочно</p></blockquote></div><p>Можно на ListView, вроде намного проще.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>обычно для этого всякие библиотеки используют</p></blockquote></div><p>Ну да.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Не-а, готового нет.</p></blockquote></div><p>А про что разговор?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sun, 25 Jun 2023 18:35:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=158599#p158599</guid>
		</item>
	</channel>
</rss>
