Message de rapport:
 

Re: Champ menu d'une fenêtre

Sujet: Re: Champ menu d'une fenêtre
par Anonyme sur 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)
Connexion
Menu
Chercher WDForge
Chercher Web
Partenaires
Visualiser tous les Partenaires...
WinDev, WebDev, WinDev Mobile et HyperFile sont des marques déposées par PCSoft. |  Voter |  Legal |  Contact |   XOOPS 2.0.13.2