RobertAlanGustafsonII
Active member
- Joined
- Sep 16, 2023
- Messages
- 39
- Programming Experience
- 10+
WHAT I HAVE:
Visual Basic 2019, .NET Framework 4.6+, WinForms
MY ISSUES:
I want to be able to use the Process class to invoke Skype from my desktop application, with arguments specifying a certain kind of Skype action. However, Skype may fire up without carrying out any action (basically, ignores the argument) if the app isn't "ready". This can be because the app is firing for the first time or has been previously quit (i.e., "Quit Skype" is triggered on the taskbar or settings has "Keep Skype running when window closes" unchecked), or because (perhaps) it hasn't "auto-logged" me in yet. The following code, which has it fire Skype without arguments, then wait until a certain number of seconds have passed or the app has exited, then fires it again with arguments, often works:
However, even a 15-second delay may not be enough if Skype is firing for the very first time in a Windows session (perhaps it needs time to "auto-log" me in, or to load something that allows it to fire faster subsequently, like many other Windows programs). Is there a more reliable way to determine when Skype is ready to handle argument-supplied commands?
Visual Basic 2019, .NET Framework 4.6+, WinForms
MY ISSUES:
I want to be able to use the Process class to invoke Skype from my desktop application, with arguments specifying a certain kind of Skype action. However, Skype may fire up without carrying out any action (basically, ignores the argument) if the app isn't "ready". This can be because the app is firing for the first time or has been previously quit (i.e., "Quit Skype" is triggered on the taskbar or settings has "Keep Skype running when window closes" unchecked), or because (perhaps) it hasn't "auto-logged" me in yet. The following code, which has it fire Skype without arguments, then wait until a certain number of seconds have passed or the app has exited, then fires it again with arguments, often works:
VB.NET:
Private Sub DoSkype(ByVal SkypeName As String) 'make video call
Dim Process As Process = New Process()
With Process.StartInfo
.FileName = SkypeDesktopFolder & "\Skyoe.exe" : .Arguments = ""
Process.Start() : Process.WaitForExit(7000)
.Arguments = "Skype:" & SkypeName & "?call&video=true"
Process.Start()
End With
End Sub
However, even a 15-second delay may not be enough if Skype is firing for the very first time in a Windows session (perhaps it needs time to "auto-log" me in, or to load something that allows it to fire faster subsequently, like many other Windows programs). Is there a more reliable way to determine when Skype is ready to handle argument-supplied commands?
Last edited by a moderator: