1

I am trying to build a simple app (As Console Application) that enters a Zoom meeting automatically at a specified time.

The app opens the Zoom meeting using Process.Start function, and then wait for the "Zoom Meeting" process to start.

It works well if I use a Windows shortcut file (.lnk extension) with the correct parameters, like shown here

But is doesn't work when I use the "regular" Zoom link (the url) because it opens the browser and waits for user input (It shows an alert).

I know how to send input to a process, so all I need is to a reference to the browser window that opened, but I can't find it.

The Process.Start doesn't return it and when I looped through all processes (Process.GetProcesses) I couldn't find any useful name that I can search for.

So, how can I get a reference to the browser process? Or at least send it input when it start.

Thanks in advance.

SagiZiv
  • 932
  • 1
  • 16
  • 38
  • When using a browser you need to connect to a URL using the Navigate method(). – jdweng Nov 12 '20 at 12:54
  • @jdweng Thanks for the respones, where can I find this method? – SagiZiv Nov 12 '20 at 13:08
  • webbrowser1.Navigate("URL"); What type of project are you using? Try a Form application and add the browser control. – jdweng Nov 12 '20 at 13:10
  • @jdweng I forgot to write, I am using a Console application to launch the meeting. The WebBrowser works on WinForms application but on Console app nothing happens. – SagiZiv Nov 12 '20 at 13:21

1 Answers1

2

=== EDIT ===

After digging in Windows Registry, I have found an even simpler code to achieve it:

public static void OpenZoomMeeting(string link)
{
    string zoomDirectory = Environment.ExpandEnvironmentVariables(@"%APPDATA%\Zoom\bin");
    ProcessStartInfo startInfo = new ProcessStartInfo
    {
        FileName = $@"{zoomDirectory}\Zoom.exe",
        Arguments = $"--url={link}",
        WorkingDirectory = zoomDirectory
    };
    Process.Start(startInfo);
}

=== OLD CODE ===

Found the solution thanks to jdweng

He said that I should to use a WebBrowser to open the meeting without the prompt, so I looked into it.

Because my app is a Console Application, I can't just use a WebBrowser so I found That solution and it worked for me.

Thank you for your help

===The code===

private void RunBrowserThread(string url) {
    var th = new Thread(() => {
        var br = new WebBrowser();
        br.DocumentCompleted += Browser_DocumentCompleted;
        br.Navigate(url);
        Application.Run();
    });
    th.SetApartmentState(ApartmentState.STA);
    th.Start();
}

void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) {
    var br = sender as WebBrowser;
    if (br.Url == e.Url) {
        Console.WriteLine("Natigated to {0}", e.Url);
        Application.ExitThread();   // Stops the thread
    }
}
SagiZiv
  • 932
  • 1
  • 16
  • 38