News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

hooking popup menus

Started by ydooW, April 05, 2009, 10:19:47 AM

Previous topic - Next topic

ydooW

Hello everyone, this is my first posting here, so excuse me if chose a wrong thread for asking this question.
I want to have custom system-wide popup menus. To draw all menus in a system in a different way.
For example, to have ability to rearrange items, to use different colours, to skip disabled menu items, add custom menu items, etc.
My first idea, was to hook CreatePopupMenu and InsertMenuItem and do whatever is needed when those api functions are caught. Would that be enough? Besides, i have 2 questions: what type of api hooking do i need to use in such case? I've googled a bit, but I'm not sure which methods fits best this scenario. The second question is: if i manage to do the drawing part, how should i pass to the underlying window, which menu item was clicked by the user? Should i post WM_MENUSELECT message to a window under the mouse cursor (which i find using WindowFromPoint)?

Thanks for attention.

P.S. Sorry for my bad english.