I also wanted to say that I am experiencing difficulties when working with StatusBar. Why can't I choose a font style for the StatusBar ? Maybe I missed something ?
I have to use this old code:
Code: Select all
; Title: Custom Statusbar Text Colors
; Author: Fluid Byte
; Date: December 28, 2006
Structure ODSBTEXT
szText.l
clrFront.l
EndStructure
Global font
font = LoadFont(#PB_Any, "FixedSys", 14)
Procedure WindowCallback(hWnd.l,uMsg.l,wParam.l,lParam.l)
Select uMsg
Case #WM_DRAWITEM
*lpdis.DRAWITEMSTRUCT = lParam
ClassName$ = Space(19) : GetClassName_(*lpdis\hwndItem,ClassName$,19)
If ClassName$ = "msctls_statusbar32"
*osbt.ODSBTEXT = *lpdis\itemData
SelectObject_(*lpdis\hDC,FontID(font))
SetTextColor_(*lpdis\hDC,*osbt\clrFront)
;SetBkColor_(*lpdis\hDC, #TRANSPARENT)
SetBkMode_(*lpdis\hDC, #TRANSPARENT)
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
OpenWindow(0,0,0,350,100,"Custom Statusbar Text Colors",#WS_OVERLAPPEDWINDOW | 1)
SetWindowCallback(@WindowCallback())
Result = CreateStatusBar(0,WindowID(0))
AddStatusBarField(100) : StatusBarText(0,0,"Statusbar Field #1")
AddStatusBarField(100) : StatusBarText(0,1,"Statusbar Field #2")
AddStatusBarField(100)
osbt.ODSBTEXT
osbt\szText = @"Statusbar Field #3"
osbt\clrFront = #Black
;osbt\clrBack = #Black
SendMessage_(Result,#SB_SETTEXT,2 | #SBT_OWNERDRAW,osbt)
While WaitWindowEvent() ! 16 : WendBy the way... there was a trick here for getting text from any StatusBar field. So... It doesn't work with this code!
Could someone take a look at this code ? What could be causing this behavior ? I haven't seen any specific pattern.
Thanks in advance.

