PDA

Click to See Complete Forum and Search --> : Hidden Coolbar Band Properties


equah
May 25th, 2001, 12:00 AM
The Coolbar Control (a.k.a Rebar Control) that shipped with VB is a subclassed version with some (many) missing funtionality. I am trying to create an custom control based on the Coolbar and I need to get rid of the gripper that is found on top of each band. A quick check with the Platform SDK determined that what I need is the message
RB_SETBANDINFO. RB_SETBANDINFO needs the REBARBANDINFO structure.
Unfortunately neither the definitions RB_SETBANDINFO or REBARBANDINFO and be found anywhere in the API Viewer. No problem, I just got the definitions translated directly from the Commtrl.h header file. All seems well but the code does not work. I suspect my declaration of REBARBANDINFO is faulty. Has anyone tried to use RB_SETBANDINFO before?

Option Explicit

Private Type REBARBANDINFO
cbSize As Long
fMask As Long
fStyle As Long
clrFore As Long
clrBack As Long
lpText As String
cch As Long
iImage As Long
hwndChild As Long
cxMinChild As Long
cyMinChild As Long
cx As Long
hbmBack As Long
wID As Long
cyChild As Long
cyMaxChild As Long
cyIntegral As Long
cxIdeal As Long
lParam As Long
cxHeader As Long
End Type

Private Const WM_USER = &H400
Private Const RB_SETBANDINFO = (WM_USER + 6)
Private Const RBBIM_STYLE = &H1
Private Const RBBS_NOGRIPPER = &H100
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Sub Command1_Click()

Dim MyBandInfo As REBARBANDINFO
With MyBandInfo
.cbSize = Len(MyBandInfo)
.fMask = RBBIM_STYLE
.fStyle = RBBS_NOGRIPPER
End With

SendMessage CoolBar1.hwnd, RB_SETBANDINFO, ByVal 0, MyBandInfo

End Sub