Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing QuickQuery HL Edition/AnimateMod.bas (2.45 KB)
Attribute VB_Name = "AnimateMod"
Private Type tagInitCommonControlsEx
lngSize As Long
lngICC As Long
End Type
Private Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As tagInitCommonControlsEx) As Boolean
Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
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 Const ICC_ANIMATE_CLASS = &H80
Private Const ANIMATE_CLASS = "SysAnimate32"
Private Const WM_USER = &H400&
Private Const ACM_OPEN = WM_USER + 100
Private Const ACM_PLAY = WM_USER + 101
Private Const ACM_STOP = WM_USER + 102
Private Const WS_EX_TRANSPARENT = &H20&
Private Const ACS_CENTER = &H1&
Private Const ACS_TRANSPARENT = &H2&
Private Const ACS_AUTOPLAY = &H4&
Public Function CreateAnimateWindow(X As Long, Y As Long, Width As Long, Height As Long, ParentWnd As Long) As Long
CreateAnimateWindow = CreateWindowEx(WS_EX_TRANSPARENT, _
ANIMATE_CLASS, "", _
&H50000000 Or ACS_TRANSPARENT, _
X, Y, Width, Height, _
ParentWnd, 0&, App.hInstance, ByVal 0&)
End Function
Public Function DestroyAnimateWindow(hWnd As Long) As Long
DestroyAnimateWindow = DestroyWindow(hWnd)
End Function
Public Function InitCommonCtrls() As Long
Dim iccex As tagInitCommonControlsEx
iccex.lngSize = Len(iccex)
iccex.lngICC = ICC_ANIMATE_CLASS
InitCommonCtrls = InitCommonControlsEx(iccex)
End Function
Public Function OpenVideoFile(hWnd As Long, Optional ByVal File As String, Optional ByVal ResourceID As Long) As Long
If File <> "" Then
OpenVideoFile = SendMessage(hWnd, ACM_OPEN, 0&, ByVal File)
ElseIf ResourceID > 0 Then
OpenVideoFile = SendMessage(hWnd, ACM_OPEN, ByVal App.hInstance, ByVal ResourceID)
End If
End Function
Public Function PlayVideo(hWnd As Long) As Long
PlayVideo = SendMessage(hWnd, ACM_PLAY, -1, 0)
End Function
Public Function StopVideo(hWnd As Long) As Long
StopVideo = SendMessage(hWnd, ACM_STOP, 0, 0)
End Function
Download QuickQuery HL Edition/AnimateMod.bas