home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
- Begin VB.Form frmCoolbar
- Caption = "Creating Coolbars from the Standard Toolbar Control"
- ClientHeight = 2535
- ClientLeft = 3660
- ClientTop = 2520
- ClientWidth = 6495
- Icon = "frmCoolbar.frx":0000
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 2535
- ScaleWidth = 6495
- StartUpPosition = 2 'CenterScreen
- Begin VB.DriveListBox Drive1
- Height = 315
- Left = 4200
- TabIndex = 0
- Top = 1590
- Width = 1740
- End
- Begin VB.PictureBox picTBContainer
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 555
- Index = 1
- Left = 0
- ScaleHeight = 555
- ScaleWidth = 7860
- TabIndex = 3
- Top = 900
- Width = 7860
- Begin ComctlLib.Toolbar Toolbar
- Height = 600
- Index = 1
- Left = 120
- TabIndex = 5
- Top = -15
- Width = 15000
- _ExtentX = 26458
- _ExtentY = 1058
- ButtonWidth = 2805
- ButtonHeight = 953
- Appearance = 1
- ImageList = "ImageList2"
- _Version = 327680
- BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
- NumButtons = 3
- BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Best of the Web"
- Object.ToolTipText = "Best of the Web"
- Object.Tag = ""
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Today's Links"
- Object.ToolTipText = "Today's Links"
- Object.Tag = ""
- ImageIndex = 1
- EndProperty
- BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Microsoft Home"
- Object.ToolTipText = "Microsoft Home"
- Object.Tag = ""
- ImageIndex = 1
- EndProperty
- EndProperty
- End
- End
- Begin VB.PictureBox picTBContainer
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 795
- Index = 0
- Left = 0
- ScaleHeight = 795
- ScaleWidth = 7860
- TabIndex = 2
- Top = 30
- Width = 7860
- Begin ComctlLib.Toolbar Toolbar
- Height = 840
- Index = 0
- Left = 120
- TabIndex = 4
- Top = -15
- Width = 15000
- _ExtentX = 26458
- _ExtentY = 1482
- ButtonWidth = 1323
- ButtonHeight = 1376
- Appearance = 1
- ImageList = "ImageList1"
- _Version = 327680
- BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
- NumButtons = 8
- BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Back"
- Object.ToolTipText = "Back"
- Object.Tag = ""
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Forward"
- Object.ToolTipText = "Forward"
- Object.Tag = ""
- ImageIndex = 2
- EndProperty
- BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Stop"
- Object.ToolTipText = "Stop"
- Object.Tag = ""
- ImageIndex = 3
- EndProperty
- BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Refresh"
- Object.ToolTipText = "Refresh"
- Object.Tag = ""
- ImageIndex = 4
- EndProperty
- BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Home"
- Object.ToolTipText = "Home"
- Object.Tag = ""
- ImageIndex = 5
- EndProperty
- BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Search"
- Object.ToolTipText = "Search"
- Object.Tag = ""
- ImageIndex = 6
- EndProperty
- BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Favorites"
- Object.ToolTipText = "Favorites"
- Object.Tag = ""
- ImageIndex = 7
- EndProperty
- BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Caption = "Print"
- Object.ToolTipText = "Print"
- Object.Tag = ""
- ImageIndex = 8
- EndProperty
- EndProperty
- End
- End
- Begin VB.PictureBox picTBContainer
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 345
- Index = 2
- Left = 0
- ScaleHeight = 345
- ScaleWidth = 7860
- TabIndex = 1
- Top = 1560
- Width = 7860
- Begin ComctlLib.Toolbar Toolbar
- Height = 420
- Index = 2
- Left = 120
- TabIndex = 6
- Top = -15
- Width = 15000
- _ExtentX = 26458
- _ExtentY = 741
- ButtonWidth = 635
- ButtonHeight = 582
- Appearance = 1
- ImageList = "ImageList3"
- _Version = 327680
- BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
- NumButtons = 11
- BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "New"
- Object.Tag = ""
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Open"
- Object.Tag = ""
- ImageIndex = 2
- EndProperty
- BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Save"
- Object.Tag = ""
- ImageIndex = 3
- EndProperty
- BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Cut"
- Object.Tag = ""
- ImageIndex = 4
- EndProperty
- BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Copy"
- Object.Tag = ""
- ImageIndex = 5
- EndProperty
- BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Paste"
- Object.Tag = ""
- ImageIndex = 6
- EndProperty
- BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Delete"
- Object.Tag = ""
- ImageIndex = 7
- EndProperty
- BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Find"
- Object.Tag = ""
- ImageIndex = 8
- EndProperty
- BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Undo"
- Object.Tag = ""
- ImageIndex = 9
- EndProperty
- BeginProperty Button10 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Redo"
- Object.Tag = ""
- ImageIndex = 10
- EndProperty
- BeginProperty Button11 {0713F354-850A-101B-AFC0-4210102A8DA7}
- Object.ToolTipText = "Help"
- Object.Tag = ""
- ImageIndex = 11
- EndProperty
- EndProperty
- BorderStyle = 1
- End
- End
- Begin VB.Label Label2
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- Caption = "http://www.geocities.com/SiliconValley/Way/6445"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00800000&
- Height = 195
- Left = 2085
- TabIndex = 8
- Top = 2280
- Width = 4365
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- Caption = "Written for the VB Center Code Library"
- BeginProperty Font
- Name = "Small Fonts"
- Size = 6.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 165
- Left = 4065
- TabIndex = 7
- Top = 2040
- Width = 2355
- End
- Begin ComctlLib.ImageList ImageList3
- Left = 1200
- Top = 1920
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 327680
- BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
- NumListImages = 11
- BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0442
- Key = ""
- EndProperty
- BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0554
- Key = ""
- EndProperty
- BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0666
- Key = ""
- EndProperty
- BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0778
- Key = ""
- EndProperty
- BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":088A
- Key = ""
- EndProperty
- BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":099C
- Key = ""
- EndProperty
- BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0AAE
- Key = ""
- EndProperty
- BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0BC0
- Key = ""
- EndProperty
- BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0CD2
- Key = ""
- EndProperty
- BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0DE4
- Key = ""
- EndProperty
- BeginProperty ListImage11 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":0EF6
- Key = ""
- EndProperty
- EndProperty
- End
- Begin ComctlLib.ImageList ImageList2
- Left = 600
- Top = 1920
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 327680
- BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
- NumListImages = 1
- BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":1008
- Key = ""
- EndProperty
- EndProperty
- End
- Begin ComctlLib.ImageList ImageList1
- Left = 0
- Top = 1920
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 327680
- BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
- NumListImages = 8
- BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":1322
- Key = ""
- EndProperty
- BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":163C
- Key = ""
- EndProperty
- BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":1956
- Key = ""
- EndProperty
- BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":1C70
- Key = ""
- EndProperty
- BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":1F8A
- Key = ""
- EndProperty
- BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":22A4
- Key = ""
- EndProperty
- BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":25BE
- Key = ""
- EndProperty
- BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "frmCoolbar.frx":28D8
- Key = ""
- EndProperty
- EndProperty
- End
- Attribute VB_Name = "frmCoolbar"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Rebar As New CRebar
- Public Sub RefreshToolbars()
- On Error Resume Next
- Dim xCount As Integer
- For xCount = 0 To Toolbar.Count - 1
- Toolbar(xCount).Refresh
- End Sub
- Private Sub Form_Load()
- ' move toolbar to the left to hide
- ' left border
- Toolbar(0).Left = -15
- Toolbar(1).Left = -15
- Toolbar(2).Left = -15
- ' Make the height
- ' It makes the pictures be on the left and the text on the right
- picTBContainer(1).Height = 340
- Rebar.TBMakeFlat Toolbar(0)
- ' making this toolbar's style list.
- Rebar.TBMakeFlat Toolbar(1), True
- Rebar.TBMakeFlat Toolbar(2)
- ' Create The Rebar
- With Rebar
- Set .Parent = Me
- .Create
- End With
- ' Add the bands with the child
- ' Syntax(on a single line):
- ' Rebar.AddBands (BandText As String,
- ' BandName As Integer, ChildWin,
- ' NewRow As BandPosition, [mWidth])
- Rebar.AddBands "", 0, picTBContainer(0).hwnd, 0, 10
- Rebar.AddBands "Links ", 1, picTBContainer(1).hwnd, 0, 10
- Rebar.AddBands "", 2, picTBContainer(2).hwnd, 0, 10
- Rebar.AddBands "", 3, Drive1.hwnd, 1, 10
- Me.Show
- picTBContainer(2).SetFocus
- End Sub
- Public Sub ProcMsg(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long, Result As Long)
- On Error Resume Next
- Dim hdr As NMHDR
- Dim RebarHdr As NMREBAR
- Dim BandInfo As RBHITTESTINFO
- Dim ptApi As POINTAPI
- Dim xReturn As Long
- Dim BandId As Integer
- Select Case uMsg
- Case WM_NOTIFY 'Needed to let us know when mouse has anything to do with Rebar
- ' Copy hdr info so we can determine if uMsg is coming from Rebar
- ' CopyMemory hdr, ByVal lParam, Len(hdr)
- CopyMemory RebarHdr, ByVal lParam, Len(RebarHdr)
- ' Check hwndFrom (handle of window sending message)
- ' If hdr.hwndFrom = Rebar.GetRebarWindow Then
- If RebarHdr.NMHDR = Rebar.GetRebarWindow Then
- Call GetCursorPos(ptApi)
- Call ScreenToClient(Me.hwnd, ptApi)
- BandInfo.ptApi = ptApi
- BandInfo.flags = RBHT_CAPTION Or RBHT_GRABBER Or RBHT_CLIENT
- Call SendMessage(Rebar.GetRebarWindow, RB_HITTEST, 0, BandInfo)
- ' Yes it's ours
- ' 8386744 = Being Sized
- ' 8387324 = ClickUp anywhere on rebar or gripper
- ' If you don't do this when using the toolbar control, then
- ' whenever you touch the Rebar or size the bands then
- ' toolbars will dissappear.
- ' A lot of Flicker
- If lParam = 8386744 Then RefreshToolbars
- If lParam = 8387324 Then RefreshToolbars
- ' older Version
- If lParam = 8386792 Then RefreshToolbars
- End If
- ' Case User changes colors while this is running
- Case WM_SYSCOLORCHANGE
- Rebar.SetBandColors
- End Select
- End Sub
- Private Sub Form_Resize()
- On Error Resume Next
- Rebar.Resize Me
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Rebar.DestroyRebar
- End Sub
-