Définit les informations pour un menu spécifié
#include <GuiMenu.au3>
_GUICtrlMenu_SetMenuInfo ( $hMenu, ByRef $tInfo )
$hMenu | Handle du contrôle Menu |
$tInfo | Structure $tagMENUINFO |
Succès: | Retourne True. |
Échec: | Retourne False. |
$tagMENUINFO, _GUICtrlMenu_GetMenuInfo
Consultez SetMenuInfo dans la librairie MSDN.
#include <GuiMenu.au3> Example() Func Example() Local $hWnd, $hMain, $hFile, $tInfo ; Ouvre le Bloc-Notes Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") $hWnd = WinGetHandle("[CLASS:Notepad]") $hMain = _GUICtrlMenu_GetMenu($hWnd) $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) ; Obtient/Définit des informations sur File $tInfo = _GUICtrlMenu_GetMenuInfo($hFile) Writeln("Menu style ..........: " & DllStructGetData($tInfo, "Style")) Writeln("Menu max height .....: " & DllStructGetData($tInfo, "YMax")) Writeln("Menu background brush: " & DllStructGetData($tInfo, "hBack")) Writeln("Menu context help ID : " & DllStructGetData($tInfo, "ContextHelpID")) Writeln("Menu data ...........: " & DllStructGetData($tInfo, "MenuData")) Writeln("") $tInfo = DllStructCreate($tagMENUINFO) DllStructSetData($tInfo, "Size", DllStructGetSize($tInfo)) DllStructSetData($tInfo, "Mask", BitOR($MIM_HELPID, $MIM_MAXHEIGHT, $MIM_MENUDATA)) DllStructSetData($tInfo, "YMax", 100) DllStructSetData($tInfo, "ContextHelpID", 1234) DllStructSetData($tInfo, "MenuData", 4567) _GUICtrlMenu_SetMenuInfo($hFile, $tInfo) $tInfo = _GUICtrlMenu_GetMenuInfo($hFile) Writeln("Menu style ..........: " & DllStructGetData($tInfo, "Style")) Writeln("Menu max height .....: " & DllStructGetData($tInfo, "YMax")) Writeln("Menu background brush: " & DllStructGetData($tInfo, "hBack")) Writeln("Menu context help ID : " & DllStructGetData($tInfo, "ContextHelpID")) Writeln("Menu data ...........: " & DllStructGetData($tInfo, "MenuData")) Writeln("") EndFunc ;==>Example ; Écrit une ligne de texte dans le Bloc-Notes Func Writeln($sText) ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CRLF) EndFunc ;==>Writeln