Results 1 to 4 of 4

Thread: Mouse_move over AVI file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Posts
    88

    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:
    1. Private Declare Function mciSendString Lib "winmm.dll" Alias _
    2. "mciSendStringA" (ByVal lpstrCommand As String, ByVal _
    3. lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
    4. hwndCallback As Long) As Long
    5.  
    6.  
    7. Private Sub Form1_Load()
    8.  
    9. Last$ = Form1.hWnd & " Style " & &H40000000
    10. ToDo$ = "open C:\Myavi.avi Type avivideo Alias video parent " & Last$
    11. x% = mciSendString(ToDo$, 0&, 0, 0)
    12. x% = mciSendString("put video window at 0 0 210 210", 0&, 0, 0)
    13. x% = mciSendString("play video", 0&, 0, 0) )
    14. End Sub
    15.  
    16. Private Sub Form_Unload(Cancel As Integer)
    17. x% = mciSendString("close video", 0&, 0, 0)
    18. 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

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    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.

  3. #3
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    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.
    McGenius

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    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.
    Frans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width