<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[win: can&#x27;t trap WM_ENTER&#x2F;EXITMENULOOP?]]></title><description><![CDATA[<p dir="auto">in the <a href="https://docs.microsoft.com/en-us/windows/win32/menurc/menus" target="_blank" rel="noopener noreferrer nofollow ugc">documentation here</a>, it indicates i can get a message when the menu bar starts to be browsed, and another when the browsing is completed.</p>
<p dir="auto">this is exactly what i need (the purpose is unrelated to this post).</p>
<p dir="auto">So in my <code>QMainWindow</code> derived class, i override the <code>nativeEvent()</code> method, like so:</p>
<pre><code>bool	QBrowserWindow::nativeEvent(
	const QByteArray&amp;	eventType,
	void			*messageP,
	qintptr			*resultP)
{
	bool		handledB(false);

	if (eventType == kWindowsEventType_GENERIC) {
		MSG&amp;		msg(*(MSG *)messageP);

		switch (msg.message) {

			default: {
				//	nothing else
			} break;

			case WM_ENTERMENULOOP: {
				Log("start menu browsing");
				SuspendTableUpdates(true);
			} break;

			case WM_EXITMENULOOP: {
				Log("end menu browsing");
				SuspendTableUpdates(false);
			} break;
		}
	}

	return handledB;
}
</code></pre>
<p dir="auto">However, those messages are never sent :(</p>
<p dir="auto">Any idea why not?</p>
]]></description><link>https://forum.qt.io/topic/131387/win-can-t-trap-wm_enter-exitmenuloop</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 15:23:08 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/131387.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Oct 2021 05:20:18 GMT</pubDate><ttl>60</ttl></channel></rss>