iriash Posted December 11, 2021 Posted December 11, 2021 (edited) hello community, I wanted to ask you if you know any udf that allows me to include icons in both menu and submenu using autoit functions like $menu = GUICtrlCreateMenu ("Menu") $menu_item = GUICtrlCreateMenuItem("item 1", $menu) I found an interesting function that allowed me to add icons in bmp format but only for the main menu, it does not work for the submenus because I am quite new to developing with AutoIT The function I use to add to the main menus is this: Func AddImageToMenu($ParentMenu, $IndexType, $MenuIndex, $BitmapMenu) $hBmpMenu = DllCall("user32.dll", "hwnd", "LoadImage", "hwnd", 0, _ "str", $BitmapMenu, _ "int", $IMAGE_BITMAP, _ "int", 0, _ "int", 0, _ "int", BitOR($LR_LOADFROMFILE, $LR_LOADMAP3DCOLORS)) $hBmpMenu = $hBmpMenu[0] DllCall("user32.dll", "int", "SetMenuItemBitmaps", "hwnd", GUICtrlGetHandle($ParentMenu), _ "int", $MenuIndex, _ "int", $IndexType, _ "hwnd", $hBmpMenu, _ "hwnd", $hBmpMenu) EndFunc It works very well but this function uses functions that I still don't quite understand how they work but I tried it and it works correctly. What I need is that if it is possible that this same function can be modified so that it also allows adding icons in the submenus of a main menu thanks and best regards Edited December 11, 2021 by iriash
Moderators Melba23 Posted December 11, 2021 Moderators Posted December 11, 2021 Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Luke94 Posted December 11, 2021 Posted December 11, 2021 GUICtrlMenuEx UDF by @Ward may be an easier solution?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now