error471 Posted February 5, 2016 Share Posted February 5, 2016 Hey folks, is it possible to easily create a context menu with colored squares? Best regards. error471 Link to comment Share on other sites More sharing options...
error471 Posted February 5, 2016 Author Share Posted February 5, 2016 (edited) Modern Menu UDF seems to be able to manage this, but it's developement stopped long time ago. Errors in the includes are actually making trouble. I found a way using this example script: #include <GuiMenu.au3> #include <WinAPI.au3> #include <Constants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> $Form1 = GUICreate("Entwurf", @DesktopWidth, @DesktopHeight, -1, -1, BitOR($WS_MAXIMIZE, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_GROUP, $WS_CLIPSIBLINGS, $ES_AUTOHSCROLL, $ES_AUTOVSCROLL)) $Datei = GUICtrlCreateMenu("&Datei") $Bearbeiten = GUICtrlCreateMenu("&Bearbeiten") $Optionen = GUICtrlCreateMenu("&Optionen") $Hilfe = GUICtrlCreateMenu("&Hilfe") $oeffnen = GUICtrlCreateMenuItem("&Öffnen", $Datei) $menuneu = GUICtrlCreateMenuItem("&Neu", $Datei) $menudruck = GUICtrlCreateMenuItem("&Drucken", $Datei) $menusave = GUICtrlCreateMenuItem("&Speichern", $Datei) $hBmpCreate = _WinAPI_LoadImage(0, "s:\folder.bmp", $IMAGE_BITMAP, 16, 16, BitOR($LR_LOADTRANSPARENT, $LR_LOADFROMFILE)) _GUICtrlMenu_SetItemBitmaps(GUICtrlGetHandle($Datei), $oeffnen, $hBmpCreate, $hBmpCreate, False) $menusearch = GUICtrlCreateMenuItem("Suchen", $Bearbeiten) $menucopy = GUICtrlCreateMenuItem("Kopieren", $Bearbeiten) $menutoexcel = GUICtrlCreateMenuItem("in Excel bearbeiten", $Bearbeiten) $menusend = GUICtrlCreateMenuItem("als E-Mail versenden", $Bearbeiten) $menueinstellungen = GUICtrlCreateMenuItem("Firmendaten aktualisieren", $Optionen) $kommission = GUICtrlCreateMenuItem("Kommission hinzufügen", $Optionen) $menuinfo = GUICtrlCreateMenuItem("Über...", $Hilfe) GUISetBkColor(0xFFFFFF) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Cheers. Edited February 5, 2016 by error471 Link to comment Share on other sites More sharing options...
LarsJ Posted February 6, 2016 Share Posted February 6, 2016 You can find an updated version of ModernMenu UDF in post 289. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
error471 Posted February 6, 2016 Author Share Posted February 6, 2016 Thank you. Maybe there is a usage for me later. Link to comment Share on other sites More sharing options...
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