请问,怎样在VB中实现 在一张GPS地图上面弹出视频播放的文件!(视频文件为自己播放,播放完后自动关闭!) 急,急,急~!

解决方案 »

  1.   

    你的GPS地图在什么控件中显示呢?PICTUREBOX /IMAGE?
      

  2.   

    http://blog.csdn.net/homezj/archive/2005/04/14/347936.aspx
      

  3.   

    毕业设计不会做、害怕答辩通不过……不要紧,有我们会帮你解决这一切!我们提供专业的计算机毕业设计和课程设计。我们可以根据您的要求,特别为您量身定做毕业设计(绝对是原创!)。并且会在程序代码里写出很详细的注释,同时也能帮您学习编程。
    有需要者登录http://xdqbysj.10mb.cn/
    QQ:
    客服一(16376208)  客服二(57293694)
      

  4.   

    Private Const WS_CHILD = &H40000000
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
    Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer 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 Function ShortName(LName As String) As String
        '取得短文件名
        Dim s As String, i As Long
        i = 512
        s = Space$(i)
        GetShortPathName LName, s, i
        ShortName = Left$(s, InStr(1, s, vbNullChar) - 1)
    End FunctionPrivate Function PlayMCI(Cmd As String, Optional ReturnStr As String) As Long
        '播放MCI
        Dim s As String
        s = Space$(256)
        PlayMCI = mciSendString(Cmd, s, 256, 0)
        ReturnStr = Left$(s, InStr(1, s, vbNullChar) - 1)
    End FunctionPrivate Function ShowVideo(strFileName As String, hwd As Long, x As Long, y As Long, w As Long, h As Long) As Long
        Dim i As Long, s As String
        If Dir(strFileName, vbHidden Or vbReadOnly Or vbSystem) = vbNullString Or strFileName = vbNullString Then Exit Function
        i = PlayMCI("open """ & ShortName(strFileName) & """ alias Song parent " & hwd & " style " & WS_CHILD & " WAIT")
        If i <> 0 Then Exit Function
        i = PlayMCI("STATUS Song WINDOW HANDLE WAIT", s)
        If i <> 0 Then GoTo fail
        i = Val(s)
        If i = 0 Then GoTo fail
        SetWindowPos i, 0, x, y, w, h, 0
        PlayMCI "play Song"
        ShowVideo = i   '若成功返回视频窗口的句柄
        Exit Function
    fail:
        PlayMCI "close Song"
    End FunctionPrivate Sub cmdPlay_Click()
        i = ShowVideo("c:\dd.wmv", Me.hWnd, 0, 0, 300, 300)
       '返回的这个句柄,很有用的,可用于移动窗口位置,或SubClass它,加上弹出菜单,响应鼠标动作等,300,300播放区域,你可以自己修改
        If i <> 0 Then
            cmdPlay.Enabled = False
            cmdStop.Enabled = True
        End If
    End Sub
    Private Sub cmdStop_Click()
        PlayMCI "close Song"
        cmdPlay.Enabled = True
        cmdStop.Enabled = False
    End SubPrivate Sub Form_Load()
        Me.ScaleMode = 3
        cmdPlay.Enabled = True
        cmdStop.Enabled = False
        cmdPlay.Caption = "播放"
        cmdStop.Caption = "停止"
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        PlayMCI "close Song"
    End Sub
      

  5.   

    Option ExplicitPrivate Sub Form_Load()
    MMControl1.Command = "Stop"
    ' Open the Movie file selected by the user.
     MMControl1.FileName = "f:\hr.wmv"
     MMControl1.hWndDisplay = picMovie.hWnd
     MMControl1.Command = "Open"
    ' If there was an error, display an error message box.
    If MMControl1.Error <> 0 Then
       MsgBox "Error. Cannot open the specified file." + vbCrLf + vbCrLf + MMControl1.ErrorMessage
       Exit Sub
    End If
       MMControl1.Command = "Play"
    End Sub
      

  6.   

    呵呵 谢谢ok999ok, 虽然和我要的不同!