Why not just disable the menu items the user is not permitted to use --
set the Enabled property to False? 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, September 15, 2008 2:15 PM
To: [email protected]
Subject: [delphi-en] How to intercept all menu events?


Existing D5 application now needs security. Most of "security" involves
protecting access to menu items.

I would like to implement this without bloating the code, adding lines
for every menu OnClick handler.

There is already an Application.OnMessage handler in the code. I thought
I might add a handler for WM_COMMAND, intercepting menu clicks at that
point. Yet nothing in the TMsg structure seems to point me back to a
specific menu item.

I see all menu items have automagically been assigned CMD ids, yet these
are not available in the data received by Application.OnMessage.

What do I not understand, or is there a better way to intercept all menu
clicks for an existing application...?

Thank you.





------------------------------------

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] Groups Links



Reply via email to