Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Enum enBorder
None = 0
Show = 1
End Enum
Dim m_thisHwnd As Long 'read only
Dim m_thisDC As Long 'read only
Dim twipWid As Long, twipHei As Long
'Default Property Values:
Const m_def_offsetX = 0
Const m_def_offsetY = 0
Const m_def_AnimatedGifPath = ""
'Property Variables:
Dim m_offsetX As Long
Dim m_offsetY As Long
Dim m_AnimatedGifPath As String
Private Sub UserControl_Resize()
WB1.Move (m_offsetX - 50), _
(m_offsetY - 50), _
(Width - m_offsetX) + 150, _
(Height - m_offsetY) + 150
Call PrintHtmlToDoc
End Sub
' C:\Documents and Settings\evan.ASTROBRI-47XH2C\Desktop\test.gif
Private Sub UserControl_Show()
'
' get the webbrowsers hwnd and hdc
Call GetWebHwnd
' cause the document_complete event to fire
WB1.Navigate "about:blank"
End Sub
Private Function navImg() As String
'
'this functions sizes the gif image
'based upon the width and height of the usercontrol
'
Dim pixwid As Long, pixhei As Long
pixwid = (Width / Screen.TwipsPerPixelX) - _
(offsetX / Screen.TwipsPerPixelX) + 5
pixhei = (Height / Screen.TwipsPerPixelY) - _
(offsetY / Screen.TwipsPerPixelY) + 5
navImg = _
"<img border='0' hspace='0' vspace='0' " & _
"width='" & pixwid & _
"' height='" & pixhei & "' " & _
"src='" & m_AnimatedGifPath & "'></body>"
End Function
Private Function NavGifHtml() As String
'
'create the body tag string which prevents
'this control from looking or acting like a browser