'------------------------------
' Get/SetWindowLong Consts
Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Const WS_SYSMENU = &H80000
' SetWindowPos consts
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_NOSIZE = &H1
Private Const SWP_FRAMECHANGED = &H20
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'-----------------------------------------------
Private Sub ActiveBar2_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
Select Case Tool.Name
Case "miFullScreen"
ActiveBar2.Bands("popView").Tools("miFullScreen").Visible = False
ActiveBar2.Bands("popView").Tools("micFullScreen").Visible = True
ActiveBar2.Bands("mnuMain").Visible = False
Me.WindowState = 2
Picture3.Visible = True
Dim wStyle As Long
wStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
wStyle = wStyle And (Not WS_CAPTION) And (Not WS_SYSMENU)
SetWindowLong Me.hWnd, GWL_STYLE, wStyle
'Force a refresh
SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_FRAMECHANGED
If ActiveBar2.Bands("mnuMain").Visible = False Then
With ActiveBar2.Bands("tbWeb").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = True
Else
With ActiveBar2.Bands("mnuMain").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = False
End If
' I'm kind of clipping the image so that it fits.
' A slightly smaller image would look better.
Animation1.Visible = True
ActiveBar2.RecalcLayout
Case "micFullScreen"
ActiveBar2.Bands("popView").Tools("miFullScreen").Visible = True
ActiveBar2.Bands("popView").Tools("micFullScreen").Visible = False
ActiveBar2.Bands("mnuMain").Visible = True
Me.WindowState = 0
Picture3.Visible = False
wStyle = GetWindowLong(Me.hWnd, GWL_STYLE)
wStyle = wStyle Or WS_CAPTION Or WS_SYSMENU
SetWindowLong Me.hWnd, GWL_STYLE, wStyle
' Force a refresh
SetWindowPos Me.hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_FRAMECHANGED
If ActiveBar2.Bands("mnuMain").Visible = False Then
With ActiveBar2.Bands("tbWeb").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = True
Else
With ActiveBar2.Bands("mnuMain").Tools("Animation")
Set .Custom = Animation1
.Visible = True
' Tool.Height/width should be in twips, its in pixels.
.Height = 300 '* Screen.TwipsPerPixelY
.Width = 550 '* Screen.TwipsPerPixelX
End With
ActiveBar2.Bands("tbWeb").Tools("Animation").Visible = False
End If
' I'm kind of clipping the image so that it fits.
' A slightly smaller image would look better.
Animation1.Visible = True
ActiveBar2.RecalcLayout
End Select
End Sub