) avec plusieurs taille d'îcones . Les icônes sont incluses dans le code
Code : Tout sélectionner
#Fenetre = 0
#BarreOutil = 1
#TB_SETIMAGELIST = 1072
#TB_GETIMAGELIST = 1073
If OpenWindow(#Fenetre, 0, 0, 200, 320, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Toolbars 32x32")
ShowWindow_(WindowID(), #SW_MAXIMIZE)
ToolBarHwnd = CreateToolBar(1, WindowID())
If CreateMenu(0, WindowID())
MenuTitle("")
EndIf
TailleIcone = 32
If ToolBarHwnd
; on envoie le message de redimensionnement
SendMessage_(ToolBarHwnd, #TB_SETBITMAPSIZE, 0, (TailleIcone << 16) + TailleIcone )
; on charge l'image
CatchImage(1000, ?FlecheGauche)
CatchImage(1002, ?Drapeau)
CatchImage(1004, ?FlecheVerticale)
; on récupère le handle de la listimage si elle existe
ListImageHwnd = SendMessage_(ToolBarHwnd, #TB_GETIMAGELIST, 0, 0)
; la listimage contient la première image
If ListImageHwnd
; on redimensionne la taille des images de la listimage en 32x 32
; après redimensionnement, la listeIlmage est vide
If ImageList_SetIconSize_(ListImageHwnd, TailleIcone , TailleIcone)
; si ImageList_SetIconSize réussi, le resultat retourné est <> 0
; on ajoute la première image puisque la liste est vide
ToolBarImageButton(1001 , UseImage(1000))
ToolBarImageButton(1003 , UseImage(1002))
ToolBarImageButton(1005 , UseImage(1004))
FreeMenu(0) ; supprime le menu pour obtenir un bon résultat
EndIf
EndIf
Else
End
EndIf
While WaitWindowEvent() <> #PB_EventCloseWindow And EventWindowID() <> WindowID()
Wend
EndIf
End
DataSection
FlecheGauche:
Data.l $00010000, $10100001, $00010000, $03680018, $00160000, $00280000
Data.l $00100000, $00200000, $00010000, $00000018, $03000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $B5B50000, $000000B5, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $FF000000, $00002060, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $FF2060FF, $0000C0FF, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2060FF00, $FFC0FFFF, $000080FF, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $60FF0000, $C0FFFF20, $FF80FFFF, $000080FF, $2060FF00, $FF2060FF
Data.l $7EFA2060, $2181FE1E, $002482FF, $00000000, $00000000, $FF000000
Data.l $FFFF2060, $80FFFFC0, $FF20C0FF, $FFFF80FF, $80FFFFC0, $FF80FFFF
Data.l $80FF2080, $2080FF20, $002080FF, $00000000, $00000000, $FF2060FF
Data.l $FFFFC0FF, $20C0FF80, $FF20C0FF, $C0FF20C0, $20C0FF20, $FF20C0FF
Data.l $80FF2080, $2080FF20, $002080FF, $00000000, $00000000, $00000000
Data.l $80FF0000, $20C0FF20, $FF20C0FF, $80FF2080, $2080FF20, $FF2080FF
Data.l $80FF2080, $2080FF20, $002080FF, $00000000, $00000000, $00000000
Data.l $00000000, $2080FF00, $FF20C0FF, $00002080, $00000000, $04000000
Data.l $02020404, $01010202, $00080C12, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $FF2080FF, $00002080, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $FF000000, $00002080, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $FFFF0000, $7FFF0000, $7FFE0000
Data.l $7FFC0000, $7FF80000, $01F00000, $01E00000, $01C00000, $01E00000
Data.l $01F00000, $7FF80000, $7FFC0000, $7FFE0000, $7FFF0000, $FFFF0000
Data.b 0, 0, -1, -1, 0, 0
FlecheVerticale:
Data.l $00010000, $10100001, $00010000, $03680018, $00160000, $00280000
Data.l $00100000, $00200000, $00010000, $00000018, $03000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2482FF00, $FF2080FF, $80FF2080, $080C1220, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2181FE00, $FF2080FF, $80FF2080, $01010220, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $1E7EFA00, $FF2080FF, $80FF2080, $02020220, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2060FF00, $FF2080FF, $80FF2080, $04040420, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2060FF00, $FF80FFFF, $80FF20C0, $00000020, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2060FF00, $FF80FFFF, $80FF20C0, $00000020, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $B5B5B500, $00000000
Data.l $00000000, $00000000, $FFC0FFFF, $80FF20C0, $00000020, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $FF2060FF
Data.l $FFFFC0FF, $80FFFF80, $FF80FFFF, $80FF20C0, $2080FF20, $FF2080FF
Data.l $00002080, $00000000, $00000000, $00000000, $00000000, $FF000000
Data.l $FFFF2060, $80FFFFC0, $FF20C0FF, $C0FF20C0, $20C0FF20, $002080FF
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $60FF0000, $C0FFFF20, $FF80FFFF, $C0FF20C0, $2080FF20, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $2060FF00, $FFC0FFFF, $80FF80FF, $00000020, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $FF2060FF, $0000C0FF, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $FF000000, $00002060, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $FFFF0000, $3FF80000, $3FF80000
Data.l $3FF80000, $3FF80000, $3FF80000, $3FF80000, $03800000, $07C00000
Data.l $0FE00000, $1FF00000, $3FF80000, $7FFC0000, $FFFE0000, $FFFF0000
Data.b 0, 0, -1, -1, 0, 0
Drapeau:
Data.l $00010000, $20200002, $00000010, $02E80000, $00260000, $10100000
Data.l $00000010, $01280000, $030E0000, $00280000, $00200000, $00400000
Data.l $00010000, $00000004, $02800000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $80000080, $80000000, $00800080
Data.l $00800000, $80800080, $80800000, $C0C00080, $000000C0, $FF0000FF
Data.l $FF000000, $00FF00FF, $00FF0000, $FFFF00FF, $FFFF0000, $000000FF
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $CC0C0000
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF
Data.l $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF
Data.l $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF
Data.l $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF
Data.l $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF
Data.l $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF
Data.l $999999F9, $CC0C9099, $CFCCCCCC, $FFFFFFFF, $999999F9, $CC0C9099
Data.l $CFCCCCCC, $FFFFFFFF, $999999F9, $00009099, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $FFFF0000, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $FFFFFFFF
Data.l $0000FFFF, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $FFFF0000, $FFFFFFFF, $FFFFFFFF
Data.l $FFFFFFFF, $FFFFFFFF, $FFFFFFFF, $0028FFFF, $00100000, $00200000
Data.l $00010000, $00000004, $00C00000, $00000000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $80000080, $80000000, $00800080
Data.l $00800000, $80800080, $C0C00000, $808000C0, $00000080, $FF0000FF
Data.l $FF000000, $00FF00FF, $00FF0000, $FFFF00FF, $FFFF0000, $000000FF
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $CC0C0000, $99FFFFCC, $CC0C9099, $99FFFFCC, $CC0C9099
Data.l $99FFFFCC, $CC0C9099, $99FFFFCC, $CC0C9099, $99FFFFCC, $CC0C9099
Data.l $99FFFFCC, $CC0C9099, $99FFFFCC, $CC0C9099, $99FFFFCC, $00009099
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.l $00000000, $FFFF0000, $FFFF0000, $FFFF0000, $00000000, $00000000
Data.l $00000000, $00000000, $00000000, $00000000, $00000000, $00000000
Data.b 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0
EndDataSection