Je n'arrive pas à trouver mon erreur, si vous avez des idées

Voici le code d'essai:
Code : Tout sélectionner
Structure TBBUTTONINFO
cbSize.l
dwMask.l
idCommand.l
iImage.l
fsState.b
fsStyle.b
cx.w
*lParam.l
*pszText.l
cchText.l
EndStructure
#TBIF_TEXT =2
#TBIF_STATE=4
#TBIF_COMMAND=$20
#TBIF_IMAGE=1
#TBIF_STYLE=8
#TBIF_LPARAM=$10
#TBIF_BYINDEX=$80000000
#TB_GETBUTTONINFO=$400+65
If OpenWindow(0, 0, 0, 150, 25, #PB_Window_SystemMenu |#PB_Window_ScreenCentered, "ToolBar")
hToolbar=CreateToolBar(0, WindowID())
If hToolbar
ToolBarStandardButton(0, #PB_ToolBarIcon_New)
ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
ToolBarStandardButton(2, #PB_ToolBarIcon_Save)
EndIf
button_info.TBBUTTONINFO
button_info\cbSize=SizeOf(TBBUTTONINFO)
button_info\dwMask=#TBIF_TEXT | #TBIF_STATE | #TBIF_COMMAND | #TBIF_IMAGE | #TBIF_STYLE | #TBIF_LPARAM
Debug SendMessage_( hToolbar, #TB_GETBUTTONINFO, 1, @button_info)
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventMenu
Debug "ToolBar ID: "+Str(EventMenuID())
EndIf
Until EventID = #PB_EventCloseWindow
EndIf