Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Nov : WM_ENTERMENULOOP, WM_EXITMENULOOP and WM_MENUSELECT

www.cryer.info
Managed Newsgroup Archive

WM_ENTERMENULOOP, WM_EXITMENULOOP and WM_MENUSELECT

Subject:WM_ENTERMENULOOP, WM_EXITMENULOOP and WM_MENUSELECT
Posted by:"Mike Graham" (m.g.homeaddre..@gmail.com)
Date:Sat, 5 Nov 2005 07:43:54

Hello group

Previously I've detected when a menu (TPopupMenu, TMainMenu) had been activated, then closed by adding handlers for:

CM_MENUCLOSED
CM_ENTERMENULOOP
CM_EXITMENULOOP

...to my main form - using Peter Below's ExPopupList.pas unit to dispatch them in response to:

WM_MENUSELECT
WM_ENTERMENULOOP
WM_EXITMENULOOP

...messages in the ExPopupList.WndProc procedure, respectively. That worked very well, I could 'pause' processing whilst menu
selections were being made, then resume after a menu selection had been completed (or the menu had been dismissed).
However, I've just started working with the DevExpress ExpressBars components, which replace the standard Delphi toolbar controls,
and I've no idea how to recreate this behaviour.

Peter mentions that: "Windows sends a WM_EXITMENULOOP message and a WM_MENUSELECT message (with some specific parameter values) to
the window owning the menu (which for TPopupMenus is a tool window maintained by the
Popuplist object in the Menus unit)." in various Google Groups archived threads where this is discussed, and I'm at a loss as to how
this is transferable to the ExpressBars components.
Actually, it's made me come to terms with how very little I understand about the relationship between the Win32 API and the VCL -
why, for example, does Windows send these messages in response to menu item selections, how does it 'know' that a given control is a
menu, and that it needs to receive them?
I don't know what I would need to do in order for Windows to send these messages when I select items in my DevExpress menus, and how
I would intercept them - I'd be grateful for any information.
I don't know what additional information might be required in order for anyone to make sense of this, the ExpressBars components for
creating TMainMenu replacements aren't derived from TMenu, for example...

Thanks in advance for any help

Info

Glossary

File Types

Replies:

www.cryer.info
Managed Newsgroup Archive