Bonjour,
Imaginons que tu lances ta vidéo avec Windows Media Player.
(Exemple de code fourni dans une application console)
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Imports System.Drawing
Module Module1
<DllImport("user32.dll")> _
Function MoveWindow(ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Boolean) As Boolean
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As Int32) As Boolean
End Function
Sub Main()
Dim pr As Process = Process.Start("wmplayer.exe", """C:\Ta video.avi"" /fullscreen")
Dim screens As Screen() = Screen.AllScreens()
If screens.Length = 2 Then 'Présence d'un second écran
Dim secScreen As Rectangle = screens(1).WorkingArea
System.Threading.Thread.Sleep(1000)
MoveWindow(pr.MainWindowHandle, secScreen.X, secScreen.Y, secScreen.Width, secScreen.Height, True)
End If
Console.Read()
End Sub
End Module
Willi
++