Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2006.03.26;
Скачать: [xml.tar.bz2];

Вниз

kol skype demo   Найти похожие ветки 

 
Thaddy   (2005-07-31 22:18) [0]

I have a beta available for skype users here:
http://www.thaddy.com/kolskype.zip

It demo"s the Skype API with KOL.
Plz. test it if you use Skype!


 
ECM ©   (2005-08-01 13:28) [1]

Has started - like works. :)


 
Thaddy   (2005-08-01 13:40) [2]

Try to skype me with handle "thaddydekoning", and you should get my answering machine!


 
Thaddy   (2005-08-01 17:09) [3]


Here"s a small demo:
{
program Project1;
uses
 Kol,
 Unit1 in "Unit1.pas";
begin
 NewForm1( Form1, nil);
 Run(Form1.form);
end.
}
unit unit1;

interface
uses
 Windows, Messages, Kol, kolskypecall;

type

PForm1=^TForm1;
TForm1=object(Tobj)
 Form:pControl;
 Btn:Pcontrol;
public
 procedure DoKeyUp( Sender: PControl; var Key: Longint; Shift: DWORD );
end;

procedure NewForm1( var Result: PForm1; AParent: PControl );

var
 Form1:pForm1;

implementation

procedure NewForm1( var Result: PForm1; AParent: PControl );
begin
 New(Result,Create);
 with Result^ do
 begin
   Form:= NewForm(AParent,"KOL Skype Call Demo").SetSize(300,100).centeronparent.Tabulate;
   form.Font.ReleaseHandle;
   form.Font.assignhandle(getstockobject(default_gui_font));
   Applet:=Form;
   Form.Add2AutoFree(Result);
   NewLabel(Form,"Enter Skype contact:").SetAlign(caTop);
   Btn:=NewEditbox(form, []).setalign(caTop).resizeparent;
   btn.OnKeyUp:=DoKeyUp;
   btn.Text:="echo123";
   btn.selstart:=length(btn.Text);
   btn.Color:=clWindow;
   form.simplestatustext:="";
 end;
end;

procedure Tform1.DoKeyUp( Sender: PControl; var Key: Longint; Shift: DWORD );
begin
if Key = 13 then
 begin
   CallSkype(btn.Text);
   Key := 0
 end
end;

end.


And here"s a simple unit to make a call in a single line:


unit kolskypecall;
{
Title   : KolSkypeCall
Author  : Thaddy de Koning
Date    : July 31, 2005
Terms   : Copyrighted freeware © 2005
Delphi Version: 4,5,6,7, 2005
Third Party Required: objects.pas, kolregistry
Description:

Make a Skype call with a single routine.
Based on sourcecode by Bob Swart (a.k.a. drBob) for The Delphi Magazine 120.
}

interface
// Simply call this with the skype CallID, like:
// CallSkype("thaddydekoning");

procedure CallSkype(const CallID: String);

implementation
uses
 windows, messages, kol, objects, KolRegistry;

type
 PSkypeConnection = ^TSkypeConnection;
 TSkypeConnection = object(TObj)
 private
   FHandle:HWnd;
   SkypeControlAPIAttach: DWord;
   SkypeControlAPIDiscover: DWord;
   SkypeAPIWindowHandle: Integer;
   FCallId:String;
 protected
   procedure WindowHook(var Msg: TMessage);
   procedure SendMessageToSkype(Str: String);
 public
   destructor destroy;virtual;
   property CallID: String read FCallID write FCallID;
   property Handle:Hwnd read FHandle;
 end;

// Make it a singleton!
var
 SkypeConnection: PSkypeConnection = nil;

function SkypeClient: String;
var
 Reg: PRegistry;
begin
 Result := "";
 Reg := NewRegistry(KEY_READ);
 try
   Reg.RootKey := HKEY_LOCAL_MACHINE;
   if Reg.OpenKey("SOFTWARE\Skype\Phone", False) then
     Result := Reg.ReadString("SkypePath")
 finally
   Reg.Free;
 end
end;

function NewSkypeConnection(aCallID: String):PSkypeConnection;
begin
 Result:=nil;
 if SkypeClient  = "" then exit;
 New(Result,Create);
 with Result^ do
 begin
   Fhandle:=AllocateHwnd(WindowHook);
   FCallID := aCallID;
   SkypeControlAPIAttach := RegisterWindowMessage("SkypeControlAPIAttach");
   SkypeControlAPIDiscover := RegisterWindowMessage("SkypeControlAPIDiscover");
   PostMessage(HWND_BROADCAST, SkypeControlAPIDiscover, FHandle, 0);
   Applet.Add2autofree(Result);
 end;
end;

procedure CallSkype(const CallID: String);
begin
 if not Assigned(SkypeConnection) then
   SkypeConnection := NewSkypeConnection(CallID)
 else
   SkypeConnection.SendMessageToSkype("CALL " + CallID)
end;

{ TSkypeConnection }

destructor TSkypeConnection.destroy;
begin
 if FHandle <> 0 then
   DeAllocateHwnd(Fhandle);
 inherited;
end;

procedure TSkypeConnection.SendMessageToSkype(Str: String);
var
 CopyData: CopyDataStruct;
begin
 if Str <> "" then
 begin
   CopyData.dwData := 0;
   CopyData.lpData := PChar(Str);
   CopyData.cbData := Length(Str)+1;
   SendMessage(SkypeAPIWindowHandle, WM_COPYDATA, FHandle,
     LPARAM(@CopyData))
 end
end;

procedure TSkypeConnection.WindowHook(var Msg: TMessage);
begin
 if Msg.Msg = SkypeControlAPIAttach then
 begin
   if Msg.LParam = 0 then
   begin
     SkypeAPIWindowHandle := Msg.WParam;
     SendMessageToSkype("CALL " + CallID)
   end;
   Msg.Result := 1
 end
 else
 if Msg.WParam = SkypeAPIWindowHandle then Msg.Result := 1;
end;

end.


KolRegistry.pas or KolExregistry.pas is available from my website.
More to follow soon!


 
Thaddy   (2005-08-02 11:53) [4]

For testers:
http://share.skype.com/developer_zone/documentation/api_v1.3_documentation

Contains the latest skype documentation.
The full protocol 5 should work.



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2006.03.26;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.043 c
15-1141221118
Сатир
2006-03-01 16:51
2006.03.26
Как получить IP-address машины в сети с помошью Delphi?


4-1136451039
ZZZ
2006-01-05 11:50
2006.03.26
Блокировка доступа к Flash устройству.


2-1142177914
Fl@sh
2006-03-12 18:38
2006.03.26
столбец с grid в combobox


1-1140432435
SergProger
2006-02-20 13:47
2006.03.26
Иконка нестандартного размера


15-1141542951
grisme
2006-03-05 10:15
2006.03.26
JAVA - скрипт





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский