Tag: Skype4Com

Skype API Basics – Part 1

What is the Skype API?
The Skype API is an easy way to create plugins that can dramatically change the way Skype functions. For example, we could make a program that reads messages out loud as we receive them instead of having to check for new messages.

The Skype API is potentially very different for each of the operating systems Skype is available for. And, of course, there are different wrappers of the API available for some of the different languages.

What Operating Systems Are Supported?

  • Linux
  • MAC
  • Windows

What Languages Are Supported?
The Windows API,Skype4COM, is supported in literally any language that can import an ActiveX DLL or using a bit of hackery and some Skype commands we can also use Windows Messages via the Win32 SendMessage API .

Wrappers are available for additional languages that aren’t necessarily updated as frequently as Skype4COM. Skype4Java is a completely cross platform, language specific, implementation of the Skype API. Unfortunately, Skype4Java is infrequently updated and often lags behind the other implementations. Skype4Py is the other language specific implementation of the Skype API and can be used with Python on Windows and Linux.

What is Skype4COM?
Skype4COM is an ActiveX dll for use on Windows. Basically, it offers us a collection of properties, objects, and interfaces that we can use to manipulate Skype. By default, Skype4COM is installed with the Skype Extras although I always think it is prudent to provide it with our application and reference the included version.

What is Skype4Java?
Skype4Java is an older language specific wrapper for use with Java and is pretty much outdated and dying. I haven’t personally used Skype4Java, but have noticed it hasn’t been updated since 2006.

What is Skype4Py?
Skype4Py as previously mentioned is the language specific wrapper for Python and is fully supported on Linux and Windows. Skype4Py contains two different naming schemes: one follows the norms of Python, and the other set of naming conventions resembles Skype4COM.

Why use the Skype API?
There are a lot of interesting applications that make use of Skype to do telemarketing (predictive dialing even!), make Skype act like a fax machine, and even completely replace the need for a telephone! Unfortunately, my first use of the Skype API was to monitor employees that were deleting their Skype history and copy all of the messages sent and received to a location.

How should I get started?
Usually, I start reading a little bit about the API before, I begin to use it but I don’t ever focus in enough to learn the API completely unless I absolutely need to. Instead of spending your time focusing on learning APIs you should instead focus on learning computer programming fundamentals or some website development fundamentals.

More coming next week!

Determine if Skype is Installed

The easiest method of checking whether Skype is installed is actually to check for a Registry Key. We, of course, can’t check C:Program Files for a Skype Directory because the user could have installed elsewhere (or maybe if 64 bit the operating system did?)

Skype’s API Document provides us with the following information:

To check if Skype is installed, in regedit check if the following key exists: HKCUSoftwareSkypePhone, SkypePath . This key points to the location of the skype.exe file. If this key does not exist, check if the HKLMSoftwareSkypePhone, SkypePath key exists. If the HKCU key does not exist but the HKLM key is present, Skype has been installed from an administrator account but not been used from the current account.

Generally, I only care if the Current User has configured Skype, so I will ignore the HKEY_LOCAL_Machine information and instead rely entirely on the HKEY_CURRENT_USER information.

You must make sure you reference: Microsoft.Win32 for the registry functions or modify the snippet slightly.

        using Microsoft.Win32;

        //Function uses Microsoft.Win32 to check registry value of 
        //HKEY_CURRENT_USERSoftwareSkypePhoneSkypePath and returns false if
        //the key is null
        private bool isSkypeUser()
        {
            RegistryKey skype = Registry.CurrentUser.OpenSubKey(@"SoftwareSkypePhone");

            if (skype != null && skype.GetValue("SkypePath") != null)
            {
                return true;
            }
            else
            {
                return false;
            }
        }