Matt Palmer
Matt Palmer

Reputation: 11

Sending commands using skype4com.dll

I am writing code to automate some features of Skype for an educational institution. One approach requires sending commands using skype4com.dll through C#.

I have no problem sending commands to Skype and it responds appropriately. However, I am unable to read any information that has been returned by commands sent.

For example, the command GET SKYPEVERSION should give a response of a version number. However, my code receives nothing. It is likely that I am doing something incorrectly.

There is no complete source of information (that I can find) on the net on how to use skype4com.dll (including archived information from developer.skype.com).

Below is a code example of how I am trying to go about this in C# (in a console application for testing).

In main:

// initialize Skype
Skype oSkype = new Skype();
if (!oSkype.Client.IsRunning)
    oSkype.Client.Start();

Console.WriteLine("Wait for Skype to load, then press ENTER");
Console.ReadLine();

// This works fine, hiding the Skype screen
Console.WriteLine("Attempting to hide Skype window using Skype commands");
Command sComm = new Command();
sComm.Blocking = true;
sComm.Timeout = 2000;
sComm.Command = "SET WINDOWSTATE HIDDEN";
oSkype.SendCommand(sComm);

// This returns nothing (nor do other commands)
Console.WriteLine("Attempting to read Skype window status using Skype commands");
Command sComm = new Command();
sComm.Blocking = true;
sComm.Timeout = 2000;
sComm.Command = "GET WINDOWSTATE";
oSkype.SendCommand(sComm);

Console.WriteLine("Reply after Skype command executed:");
Console.WriteLine(sComm.Reply); // NOTHING... NADA... ZIP...

It's hard finding information in 2018 on how to do this. Hopefully someone out there might remember how to go about using this DLL.

Upvotes: 1

Views: 471

Answers (0)

Related Questions