Advertisement
Guest User

Untitled

a guest
Aug 8th, 2022
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.87 KB | None | 0 0
  1. using WinFormsApp1.ext;
  2.  
  3. namespace WinFormsApp1
  4. {
  5.     static class Program
  6.     {
  7.         /// <summary>
  8.         ///  The main entry point for the application.
  9.         /// </summary>
  10.  
  11.         public static List<Window> AllWindows = new List<Window>();
  12.         public static PyHelper pyHelper = new PyHelper();
  13.  
  14.         [STAThread]
  15.         static void Main()
  16.         {
  17.             ApplicationConfiguration.Initialize();
  18.             Window tg = new Window("Google - Desktop", "https://www.google.com/");
  19.             int NextMove = 0;
  20.             // For Screen in Screen.AllScreens
  21.             foreach(Screen screen in Screen.AllScreens)
  22.             {
  23.                 if(NextMove == 0)
  24.                 {
  25.                     WinAPI.MoveWindow(tg.Handle, NextMove, 0, screen.Bounds.Width, screen.Bounds.Height, true);
  26.                     tg.WindowState = FormWindowState.Maximized;
  27.                     AllWindows.Add(tg);
  28.                 } else
  29.                 {
  30.                     Window CurrentWindow = new Window("Bing - Desktop", "https://www.bing.com/");
  31.                     WinAPI.MoveWindow(CurrentWindow.Handle, NextMove, 0, screen.Bounds.Width, screen.Bounds.Height, true);
  32.                     CurrentWindow.WindowState = FormWindowState.Maximized;
  33.                     CurrentWindow.Show();
  34.                     AllWindows.Add(CurrentWindow);
  35.                 }
  36.                 NextMove += screen.Bounds.Width;
  37.             }
  38.             Thread SocketServer = new Thread(pyHelper.SocketServer);
  39.             SocketServer.Start();
  40.             Application.Run(tg);
  41.         }
  42.  
  43.         public static List<Window> GetWindows() {
  44.             return AllWindows;
  45.         }
  46.  
  47.         public static void SetUrl(string url)
  48.         {
  49.             foreach(Window win in AllWindows)
  50.             {
  51.                 win.webView21.NavigateToString(url);
  52.             }
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement