Type of callback function that controls appearance and functioning of OllyDbg menus and shortcuts.
typedef int MENUFUNC(struct t_table *ptable,wchar_t *name,ulong index,int mode);
Parameters:
ptable
(in) Pointer to the structure of type t_table, descriptor of the table which displays menu. ptable is NULL if menu item belongs to the main OllyDbg menu
name
(in, out) Pointer to the UNICODE string TEXTLEN wide characters long. When menu function is called called with mode=MENU_VERIFY, it contains text of the menu item stripped from the control characters. Menu function may change this text. When mode is MENU_EXECUTE, name is undefined and should not be used
index
(in) The same as index in the processed t_menu descriptor, allows to use the same menu function with several different (but similar) menu items
mode
(in) One of the following constants:
MENU_VERIFY - menu creation. Menu function should decide whether menu item applies and set its name and appearance
MENU_EXECUTE - menu item was selected. Menu function should make necessary actions
MENU_VERIFY - menu creation. Menu function should decide whether menu item applies and set its name and appearance
MENU_EXECUTE - menu item was selected. Menu function should make necessary actions
Return values:
When called with mode=MENU_VERIFY, menu function should return one of the following codes:
MENU_ABSENT - menu item does not apply and will not appear the menu
MENU_NORMAL - menu item appears in the menu
MENU_CHECKED - menu item appears in the menu and has attached checkmark
MENU_CHKPARENT - menu item appears in the menu and has attached checkmark. Additionally, OllyDbg attaches checkmark to the parent item in the menu on the previous level. This feature will not work in the main menu
MENU_SHORTCUT - menu item is a pure shortcut. It does not appear in the menu but is active and participates in the search for keyboard shortcuts
MENU_GRAYED - item is present in the menu but is disabled. This style is not compatible with OllyDbg's look-and-feel, use it only if absolutely necessary due to the menu logic.
When called with mode=MENU_EXECUTE, it should return one of the following codes:MENU_NORMAL - menu item appears in the menu
MENU_CHECKED - menu item appears in the menu and has attached checkmark
MENU_CHKPARENT - menu item appears in the menu and has attached checkmark. Additionally, OllyDbg attaches checkmark to the parent item in the menu on the previous level. This feature will not work in the main menu
MENU_SHORTCUT - menu item is a pure shortcut. It does not appear in the menu but is active and participates in the search for keyboard shortcuts
MENU_GRAYED - item is present in the menu but is disabled. This style is not compatible with OllyDbg's look-and-feel, use it only if absolutely necessary due to the menu logic.
MENU_REDRAW - menu action has global impact, all OllyDbg windows must be updated. OllyDbg broadcasts WM_USER_CHGALL
MENU_NOREDRAW - no redrawing is necessary
MENU_NOREDRAW - no redrawing is necessary
Example:
See here
See also: