;Autor: Fluid Byte EnableExplicit Structure ODSBTEXT szText.l clrFront.l clrBack.l EndStructure Define EventID Define osbt.ODSBTEXT Procedure WindowCallback(hWnd.l,uMsg.l,wParam.l,lParam.l) Protected *lpdis.DRAWITEMSTRUCT Protected ClassName$ Protected *osbt.ODSBTEXT Protected aBorders.RECT Select uMsg Case #WM_DRAWITEM *lpdis.DRAWITEMSTRUCT = lParam ClassName$ = Space(19) : GetClassName_(*lpdis\hwndItem,ClassName$,19) If ClassName$ = "msctls_statusbar32" *osbt.ODSBTEXT = *lpdis\itemData SetTextColor_(*lpdis\hDC,*osbt\clrFront) SetBkColor_(*lpdis\hDC,*osbt\clrBack) SendMessage_(*lpdis\hwndItem,#SB_GETBORDERS,0,aBorders.RECT) InflateRect_(*lpdis\rcItem,-aBorders\right / 2,0) DrawText_(*lpdis\hDC,*osbt\szText,-1,*lpdis\rcItem,#DT_SINGLELINE | #DT_VCENTER) EndIf EndSelect ProcedureReturn #PB_ProcessPureBasicEvents EndProcedure If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) SetWindowCallback(@WindowCallback()) If CreateStatusBar(1,WindowID(0)) AddStatusBarField(100) AddStatusBarField(100) AddStatusBarField(100) StatusBarText(1,0,"Statusbar Field #1") StatusBarText(1,1,"Statusbar Field #2") EndIf osbt.ODSBTEXT osbt\szText = @"Statusbar Field #3" osbt\clrFront = #Green osbt\clrBack = #Black SendMessage_(StatusBarID(1),#SB_SETTEXT,2 | #SBT_OWNERDRAW,osbt) Repeat EventID=WaitWindowEvent() If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf