Pastebin
Retrouvez, créez et partagez vos snippets en temps réel.
Rechercher un Pastebin
Aucun paste trouvé.
Créer un paste
Pastebin
Blog
test2
# --- Variables des URLs --- $urls = @( "https://news.google.com", # Écran 1 - News "https://weather.com", # Écran 2 - Météo "http://IP_DE_TES_CAMERAS", # Écran 3 - Caméras "https://www.tradingview.com" # Écran 4 - Bourse ) # --- Dimensions des écrans --- $screenWidth = 2560 $screenHeight = 1440 # --- Ajouter fonction MoveWindow --- Add-Type @" using System; using System.Runtime.InteropServices; public class WinAPI { [DllImport("user32.dll")] public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); } "@ # --- Lancer Edge et déplacer chaque fenêtre --- for ($i=0; $i -lt $urls.Count; $i++) { Start-Process "msedge.exe" "--kiosk $($urls[$i]) --edge-kiosk-type=fullscreen" # --- Attendre que la fenêtre Edge existe --- $hwnd = 0 $tries = 0 while (($hwnd -eq 0) -and ($tries -lt 20)) { Start-Sleep -Milliseconds 500 $hwnd = (Get-Process msedge | Select-Object -Last 1).MainWindowHandle $tries++ } if ($hwnd -eq 0) { Write-Host "Impossible de récupérer la fenêtre Edge pour $($urls[$i])" continue } # --- Calculer la position horizontale --- $x = $i * $screenWidth $y = 0 # --- Déplacer la fenêtre --- $result = [WinAPI]::MoveWindow($hwnd, $x, $y, $screenWidth, $screenHeight, $true) if (-not $result) { Write-Host "Échec du déplacement de la fenêtre $($urls[$i])" } else { Write-Host "Fenêtre $($urls[$i]) placée sur l'écran $($i+1)" } } Write-Host "Mur d'écrans initialisé !"
Créé il y a 1 semaine.