ToolBar Icons - nur Bitmap?

  • ich wollte fragen ob es irgendwie möglich ist auch an andere Icon Bilder als mit
    _GUICtrlToolbar_AddBitmap ($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
    zu kommen...

    und es sollen keine Bitmap bilder sein ich brauch selbst erstellte .ico dateien am besten dadrin

    Einmal editiert, zuletzt von Karill Endusa (18. Januar 2010 um 17:47)

  • Icons gehen auch:

    Spoiler anzeigen
    [autoit]


    #include <GuiToolbar.au3>
    #include <GuiConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Constants.au3>
    #include <WinAPI.au3>
    #include <GuiImageList.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('MustDeclareVars', 1)

    [/autoit] [autoit][/autoit] [autoit]

    $Debug_TB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

    [/autoit] [autoit][/autoit] [autoit]

    Global $hlibary = @ScriptDir &"\fertig.dll" ;der Pfad zu deiner .dll
    Global $hToolbar, $iMemo
    Global $iItem ; Command identifier of the button associated with the notification.
    Global Enum $idNew = 1000, $idOpen, $idSave, $idHelp

    [/autoit] [autoit][/autoit] [autoit]

    _Main()

    [/autoit] [autoit][/autoit] [autoit]

    Func _Main()
    Local $hGUI, $aSize, $hImage, $count
    local $test = 2000
    ; Create GUI
    $hGUI = GUICreate("Toolbar", 600, 400)
    $hToolbar = _GUICtrlToolbar_Create ($hGUI)
    $hImage = _GUIImageList_Create()
    $count = _WinAPI_ExtractIconEx($hlibary, -1, 0, 0, 0)

    for $i = 0 to $count -1
    _GUIImageList_AddIcon($hImage, $hlibary, $i,1)
    next
    _GUIImageList_SetBkColor($hImage, 0x0000FF)
    _GUIImageList_SetIconSize($hImage, 16, 16)
    _GUICtrlToolbar_SetImageList($hToolbar, $hImage)

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    ; Add standard system bitmaps
    ;_GUICtrlToolbar_AddBitmap ($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)

    [/autoit] [autoit][/autoit] [autoit]

    ; Add buttons
    ;_GUICtrlToolbar_AddButton ($hToolbar, $idNew, $STD_FILENEW)
    ;_GUICtrlToolbar_AddButton ($hToolbar, $idOpen, $STD_FILEOPEN)
    ;_GUICtrlToolbar_AddButton ($hToolbar, $idSave, $STD_FILESAVE)
    ;_GUICtrlToolbar_AddButtonSep ($hToolbar)
    ;_GUICtrlToolbar_AddButton ($hToolbar, $idHelp, $STD_HELP)
    ;_GUICtrlToolbar_AddButtonSep ($hToolbar)
    _GUICtrlToolbar_AddButton ($hToolbar, $test, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_Main

    [/autoit]
  • Man kann sogar verschiedene Bilder für Hot, Normal und Disabled machen ;)

    [autoit]

    _GUICtrlToolbar_SetImageList
    _GUICtrlToolbar_SetHotImageList
    _GUICtrlToolbar_SetDisabledImageList

    [/autoit]