**EDIT : sorry if posting code here is/was inappropriate. For some reason I decided that this was a coding question and I was in the coding forum! More coffee needed...
=========================
I would recommend that you use the nxToolbar library (or one of Eddy's toolbar libs).
However, if a hack will suffice...
Code: Select all
Procedure callback(hWnd, uMsg, wParam, lParam)
Protected result, *nmt.NMTOOLBAR, rc.RECT
result = #PB_ProcessPureBasicEvents
Select uMsg
Case #WM_NOTIFY
*nmt = lParam
If *nmt\hdr\code = #TBN_DROPDOWN ;User has clicked our toolbar button's drop down arrow.
;Get screen co-ordinates of the button.
SendMessage_(*nmt\hdr\hwndFrom, #TB_GETRECT, *nmt\iItem, rc)
MapWindowPoints_(*nmt\hdr\hwndFrom, 0, rc, 2)
;Display pop-up menu.
DisplayPopupMenu(0, WindowID(0), rc\left, rc\bottom)
EndIf
EndSelect
ProcedureReturn result
EndProcedure
If OpenWindow(0, 0, 0, 150, 25, "ToolBar", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
;Create a pop-up menu.
If CreatePopupMenu(0)
MenuItem(100, "Cut")
MenuItem(101, "Copy")
MenuItem(102, "Paste")
EndIf
;Create our toolbar.
hTb = CreateToolBar(0, WindowID(0))
If hTb
ToolBarStandardButton(0, #PB_ToolBarIcon_New)
ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
ToolBarStandardButton(2, #PB_ToolBarIcon_Save)
;Add a drop down button.
fStyle = SendMessage_(hTb,#TB_GETEXTENDEDSTYLE,0,0)
SendMessage_(hTb, #TB_SETEXTENDEDSTYLE, 0, fSTyle | #TBSTYLE_EX_DRAWDDARROWS)
With btn.TBBUTTON
\iBitmap = #PB_ToolBarIcon_Print+1
\idCommand = 3
\fsState = #TBSTATE_ENABLED
\fsStyle = $8|#BTNS_SHOWTEXT|#TBSTYLE_AUTOSIZE
\dwData = 0
\iString = -1
SendMessage_(hTb, #TB_ADDBUTTONS,1, btn)
EndWith
EndIf
SetWindowCallback(@callback())
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Menu
Debug "Menu ID: "+Str(EventMenu())
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
I say 'hack' because you have some work to do if you wish to add a custom image button having a drop down arrow.

I may look like a mule, but I'm not a complete ass.