Jump to content

Context menu with colored square icons.


 Share

Recommended Posts

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 by error471
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...