我的代码如下:
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
Public Function OpenMultimedia(hWnd As Long, Aliasname As String, filename As String, typeDevice As String) As StringDim cmdToDo As String * 255
Dim dwReturn As Long
Dim ret As String * 128
Dim tmp As String * 255
Dim lenShort As Long
Dim ShortPathAndFile As String
Const WS_CHILD = &H40000000lenShort = GetShortPathName(filename, tmp, 255)
ShortPathAndFile = Left$(tmp, lenShort) 'cut short path from buffer
cmdToDo = "open " & ShortPathAndFile & " type " & typeDevice & " Alias " & Aliasname & " parent " & hWnd & " Style " & WS_CHILD
dwReturn = mciSendString(cmdToDo, 0&, 0&, 0&)If Not dwReturn = 0 Then  'not success
    mciGetErrorString dwReturn, ret, 128 'Get the error
    Debug.Print ret
    OpenMultimedia = ret: Exit Function
End If'Success
OpenMultimedia = "Success"
End Function不关闭程序第二次执行到此处时Debug.Print ret的结果是The specified alias is already being used in this application.  Use a unique alias.又是第一次打开时也会报错堆栈溢出!
请指教,或给出一个能调整窗口大小的播放mpg的例子也可以。