Function Reference


_GUICtrlToolbar_AddBitmap

Adds images to the image list

#include <GuiToolbar.au3>
_GUICtrlToolbar_AddBitmap ( $hWnd, $iButtons, $hInst, $iID )

Parameters

$hWnd Handle to the control
$iButtons Number of button images in the bitmap
$hInst Handle to the module instance with the executable file that contains a bitmap resource.
To use bitmap handles instead of resource IDs, set this to 0. You can add system defined button bitmaps to the list by specifying -1 as the $hInst member and one of the following values as the $iID member:
    $IDB_STD_LARGE_COLOR - Adds large, color standard bitmaps
    $IDB_STD_SMALL_COLOR - Adds small, color standard bitmaps
    $IDB_VIEW_LARGE_COLOR - Adds large, color view bitmaps
    $IDB_VIEW_SMALL_COLOR - Adds small, color view bitmaps
$iID If $hInst is 0, set this member to the bitmap handle of the bitmap with the button images.
Otherwise, set it to the resource identifier of the bitmap with the button images.
The following are resource IDs to the standard and view bitmaps:
    $STD_COPY - Copy image
    $STD_CUT - Cut image
    $STD_DELETE - Delete image
    $STD_FILENEW - New file image
    $STD_FILEOPEN - Open file image
    $STD_FILESAVE - Save file image
    $STD_FIND - Find image
    $STD_HELP - Help image
    $STD_PASTE - Paste image
    $STD_PRINT - Print image
    $STD_PRINTPRE - Print preview image
    $STD_PROPERTIES - Properties image
    $STD_REDOW - Redo image
    $STD_REPLACE - Replace image
    $STD_UNDO - Undo image
    $VIEW_DETAILS - View details image
    $VIEW_LARGEICONS - View large icons image
    $VIEW_LIST - View list image
    $VIEW_SMALLICONS - View small icons image.
    $VIEW_SORTDATE - Sort by date image.
    $VIEW_SORTNAME - Sort by name image.
    $VIEW_SORTSIZE - Sort by size image.
    $VIEW_SORTTYPE - Sort by type image.

Return Value

Success: the 0-based index of the first new image.
Failure: -1.

Related

_GUICtrlToolbar_LoadBitmap

Example

#include <GUIConstantsEx.au3>
#include <GuiToolbar.au3>
#include <WinAPIConstants.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("Toolbar Add Bitmao (v" & @AutoItVersion & ")", 400, 300)
        Local $hToolbar = _GUICtrlToolbar_Create($hGUI)
        GUISetState(@SW_SHOW)

        ; Set ANSI format
;~     _GUICtrlToolbar_SetUnicodeFormat($hToolbar, False)

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

        ; Add buttons
        Local Enum $e_idNew = 1000, $e_idOpen, $e_idSave, $idHelp
        _GUICtrlToolbar_AddButton($hToolbar, $e_idNew, $STD_FILENEW)
        _GUICtrlToolbar_AddButton($hToolbar, $e_idOpen, $STD_FILEOPEN)
        _GUICtrlToolbar_AddButton($hToolbar, $e_idSave, $STD_FILESAVE)
        _GUICtrlToolbar_AddButtonSep($hToolbar)
        _GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example