Re: Champ menu d'une fenêtre

Posté par Anonyme le 7/7/2006 9:44:47
WM_MENUCOMMAND = 294

//A mettre dans la partie déclarations globales de votre fenêtre
gnhMain is int = Handle()

WM_MENUCOMMAND Notification
The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.

Syntax

WM_MENUCOMMAND

WPARAM wParam
LPARAM lParam;

Parameters

wParam
Specifies the zero-based index of the item selected.
Windows 98/Me: The high word is the zero-based index of the item selected. The low word is the item ID.

lParam
Handle to the menu for the item selected.
Return Value

No return value.
Remarks

The WM_MENUCOMMAND message gives you a handle to the menu—so you can access the menu data in the MENUINFO structure—and also gives you the index of the selected item, which is typically what applications need. In contrast, the WM_COMMAND message gives you the menu item identifier.

The WM_MENUCOMMAND message is sent only for menus that are defined with the MNS_NOTIFYBYPOS flag set in the dwStyle member of the MENUINFO structure.

Pour modifier MENUINFO utilisez l'API
SetMenuInfo

Pour obtenir le handle de votre menu utilisez l'API GetMenu de la façon suivante :
hMenu is int = API("User32", "GetMenu", gnhMain)

Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=17&topic_id=4252&post_id=17862