EnableExplicit Define EventID Define bgimage Define hBrush Global hwndTB #TBN_HOTITEMCHANGE = $FFFFFD37 bgimage = LoadImage(#PB_Any,"C:\Windows\System32\oobe\background.bmp");Beispiel-Pfad überprüfen und ggf. anpassen Procedure WindowCallback(hWnd,uMsg,wParam,lParam) Protected *notify.NMTOOLBAR Select uMsg Case #WM_NOTIFY *notify = lparam If *notify\hdr\code = #TBN_HOTITEMCHANGE InvalidateRect_(hwndTB,0,#True) EndIf EndSelect ProcedureReturn #PB_ProcessPureBasicEvents EndProcedure If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) If OpenWindow(1,50,50,200,100,"",#WS_CHILD,WindowID(0)) hBrush = CreatePatternBrush_(ImageID(bgimage)) SetClassLongPtr_(WindowID(1), #GCL_HBRBACKGROUND, hBrush) InvalidateRect_(WindowID(1), #Null, #True) hwndTB = CreateToolBar(0,WindowID(1)) ToolBarStandardButton(0,#PB_ToolBarIcon_New) ToolBarStandardButton(1,#PB_ToolBarIcon_Open) ToolBarStandardButton(2,#PB_ToolBarIcon_Save) SendMessage_(hwndTB,#TB_SETSTYLE,0,SendMessage_(hwndTB,#TB_GETSTYLE,0,0) | #CCS_NODIVIDER) SetWindowCallback(@WindowCallback()) EndIf Repeat EventID=WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf