|
-
Apr 15th, 2003, 08:16 AM
#1
Thread Starter
Lively Member
Mouse_move over AVI file
Hi,
I am trying to create LogIN screen with avi file in the background
I've run AVI on form with this code
VB Code:
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long
Private Sub Form1_Load()
Last$ = Form1.hWnd & " Style " & &H40000000
ToDo$ = "open C:\Myavi.avi Type avivideo Alias video parent " & Last$
x% = mciSendString(ToDo$, 0&, 0, 0)
x% = mciSendString("put video window at 0 0 210 210", 0&, 0, 0)
x% = mciSendString("play video", 0&, 0, 0) )
End Sub
Private Sub Form_Unload(Cancel As Integer)
x% = mciSendString("close video", 0&, 0, 0)
End Sub
but when AVI starts VB doesn't fire form1_onMouseMove event
On Form1_onMouseMove I have this code
frmMain.Show
Without AVI in the back this code works fine
-
Apr 15th, 2003, 08:24 AM
#2
Just a thought: Add a Timer and call GetCursorPos in the Timer event and make some simple calculation to check if the mouse is over your form.
-
Apr 15th, 2003, 08:24 AM
#3
Frenzied Member
MouseMove occurs ONLY if you phisically move your mousepointer over some object (in your case it's a Form1). What you need is something like the following senario:
If you need to show your splash screen (assuming it's a Form1) then you may use Timer, have it run for let's say 5 sec and once time is up - hide (unload) Form1 and show your main form.
-
Apr 15th, 2003, 08:43 AM
#4
The problem occurs because the mci command creates a new window, with windowclass AVIWnd32, and sets it's parent to your form. The mousemove windowmessages go to this AVIWnd32 window, and not to your form.
If you really want to load a form when the user moves the mouse over the window, you can either use Joacim Andersson's approach, or you can subclass the AVIWnd32 window, and look for WM_MOUSEMOVE messages.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|