Vadim Zeitlin
unread,May 6, 2026, 8:56:07 AM (8 days ago) May 6Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wx-...@googlegroups.com
On Tue, 5 May 2026 21:48:07 -0700 (PDT) 'wsu' via wx-dev wrote:
w> I am looking at wxMSW wxFrame::MSWDoTranslateMessage()
w> and wxAcceleratorTable::Translate(), and it doesn't look like there is any
w> way to determine which command is about to be sent, and therefore no way to
w> generate the appropriate wxUpdateUIEvent.
Well, we have the ID and we probably could find the object that will be
handling it, but there is a simpler solution...
w> On the other hand, wxWindowMSW::HandleCommand() knows what command to
w> test with wxUpdateUIEvent, but I don't see a how to check whether the
w> command came from a menu or from an accelerator key.
Win32 provides this information to WM_COMMAND handler: the high word of
wParam is 0 for menu events and 1 for accelerators. There is a potential
ambiguity for WM_COMMAND sent for a control with ID=1, but I think nothing
really bad would happen if we sent an unwanted wxUpdateUIEvent in the
latter case, so we could simply always send it if HIWORD(wParam) != 0.
Regards,
VZ