De: Laurent longre Objet: Re: pb video avec mciSendStringA Date : samedi 1 juillet 2000 17:44 Les trois derniers paramètres sont les suivants (extrait de l'API Win32): - lpszReturnString : Address of a buffer that receives return information. If no return information is needed, this parameter can be NULL. - cchReturn : Size, in characters, of the return buffer specified by the lpszReturnString parameter. - hwndCallback : Handle of a callback window if the "notify" flag was specified in the command string. Pour afficher par exemple la vidéo au milieu de l'écran : '=================================================== Private Type RECT Left As long Top As long Right As long Bottom As long End Type Private Type POINTAPI x As long y As long End Type Private Type WINDOWPLACEMENT Length As long flags As long showCmd As long ptMinPosition As POINTAPI ptMaxPosition As POINTAPI rcNormalPosition As RECT End Type Private Declare function GetWindowPlacement Lib "User32" _ (ByVal hWnd As long, lpwndpl As WINDOWPLACEMENT) As long Private Declare function GetDC Lib "User32" (ByVal hWnd As long) As long Private Declare function GetDeviceCaps Lib "Gdi32" (ByVal hdc As long, _ ByVal nIndex As long) As long Private Declare function ReleaseDC Lib "User32" (ByVal hWnd As long, _ ByVal hdc As long) As long Private Declare function mciSendStringA Lib "Winmm.dll" _ (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _ ByVal uReturnLength As long, ByVal hWndCallback As long) As long Private Declare function findWindowA Lib "User32" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As long Private Declare function MoveWindow Lib "User32" _ (ByVal hWnd As long, ByVal x As long, ByVal y As long, _ ByVal nWidth As long, ByVal nHeight As long, _ ByVal bRepaint As long) As long Sub Play() Dim Fichier As String, hWnd As long, DC As long Dim Placement As WINDOWPLACEMENT Dim LEcr As long, HEcr As long Dim LImg As long, HImg As long Fichier = "C:\Temp\Test.avi" Placement.Length = 44 DC = GetDC(0) LEcr = GetDeviceCaps(DC, 8) HEcr = GetDeviceCaps(DC, 10) ReleaseDC 0, DC mciSendStringA "play " & Fichier, 0, 0, 0 hWnd = findWindowA(vbNullString, Dir$(Fichier)) GetWindowPlacement hWnd, Placement With Placement.rcNormalPosition LImg = .Right - .Left HImg = .Bottom - .Top End With MoveWindow hWnd, (LEcr - LImg) \ 2, (HEcr - HImg) \ 2, LImg, HImg, 1 End Sub '=================================================== J'imagine qu'il y a un moyen beaucoup plus simple et moins "cochon" avec les fonctions MCI, mais comme je n'y connais rien... Bonne chance, Laurent denis boidart a écrit : > > excel 97 win 95 > voici mon ex : > > Private Declare function Avi Lib "winmm.dll" Alias "mciSendStringA" (ByVal > commande As String, ByVal x1 As String, ByVal x2 As long, ByVal x3 As long) > As long > > Sub play() > > Dim returncode As long > Dim A$ as String > A$ = "c:\avi.avi" > returncode = Avi("play " & A$, 0, 0, 0) > > End Sub > > a quoi sert les 0,0,0 ? > comment faire pour que la vidéo s affiche à l'endroit desiré sur l'ecran ?