Wiki Home

Skype 4 COM


Namespace: WIN_COM_API
https://developer.skype.com/Docs/Skype4COM

Skype 4 COM is an interface which represents the Skype API as objects, with properties, commands, and events and notifications. Use Skype 4 COM in any ActiveX environment, such as Visual Studio or Delphi, and use familiar scripting languages, such as Visual Basic, PHP, or Javascript.

Skype 4 Com.dll is automatically included together with Skype Extras Manager during Skype installation. If a user has unchecked Extras Manager during installation, Skype 4 Com library will be unavailable on that machine.

The following code returns list of calls (Skype must be running)
LOCAL oSkype As Skype4COM.Skype, ex As Exception

TRY
	oSkype = CREATEOBJECT("Skype4COM.Skype", "Skype_")
CATCH TO ex
ENDTRY

IF VARTYPE(m.ex)='O'
	= MESSAGEBOX(TRANSFORM(ex.ErrorNo)+'. '+;
		ex.Message,48,'Skype4COM.Skype Init Error')
	RETURN
ENDIF
IF TYPE('oSkype.Calls')<>'O'
	= MESSAGEBOX('Failed to initialize.',48,;
		'Skype4COM.Skype Init Error')
	RETURN
ENDIF

CREATE CURSOR SkypeCalls (CallId I, DisplayName C(50), SkypeName C(50),;
	timestamp T, duration I, callstatus I)

LOCAL oCall
FOR EACH oCall IN oSkype.Calls
	WITH oCall
		INSERT INTO SkypeCalls (CallId, DisplayName, SkypeName,;
			timestamp, duration, callstatus );
		VALUES (.id, .PartnerDisplayName, .PartnerHandle, .Timestamp, .Duration, .Status)
	ENDWITH
NEXT

SELECT SkypeCalls
GO TOP
BROWSE NORMAL NOWAIT


-- Anatoliy Mogylevets
I adapted your code, and it worked fine until about Skype 5.5.x.x (I really ran it periodically), and now the new installs of Skype seem to uninstall Skype 4 COM. It also seems to omit the extras manager, which is necessary for the COM object to work, or else any attempt to access any PEMs of the oSkype object gives a 1426 error, with "8002801d: Library not registered". More light shed on this at http://community.skype.com/t5/Public-API/quot-Could-not-connect-object-quot-Skype4Com-in-vbscript/td-p/1474/page/3

-- skype4com now comes as a separate download, and just works as advertised... not that it's advertised much.
-- Dragan Nedeljkovich

I am using Skype version 6.0.0.126. It came with the Skype 4 COM.dll, and it works fine! Skype 4 Com has been included with the Skype client installation automatically since version 5.6.0.105.
--MKStiles

Skype URIs provide a simple way for you to initiate Skype calls and chats directly from websites, desktop, and mobile apps.
* Note that:
* Skype must be installed on the local computer
* The phone number must be fully quialified: starts with +1, 10 digits following
* Not just phone numbers can be called, but Skype names as well

PlaceSkypeCall('+1-866-217-1106') && Canadian Tire Petroleum help line

PROCEDURE PlaceSkypeCall(cSkypeNumber as String)
	* this API declaration can be moved to the init part,
	* no need to call it each time
	DECLARE INTEGER ShellExecute IN shell32;
		INTEGER hWindow, STRING lpOperation,;
		STRING lpFile, STRING lpParameters,;
		STRING lpDirectory, INTEGER nShowCmd

	ShellExecute(;
		_vfp.hWnd,;
		'Open',;
		'skype:' + m.cSkypeNumber + '?call',;
		'', '', 5)

-- Anatoliy Mogylevets
( Topic last updated: 2015.09.08 06:16:39 PM )