Help - Search - Members - Calendar
Full Version: Launch Skype From Delphi Take's 99 % of CPU
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
Enan0
Hi Guy's, Im Developing with:
Delphi 5
SKYPE4COMLib_TLB Imported From (Skype4COM.dll ver 1.0.27.1)

I have That Issue, I Check If skype are Running in the Machine, If not I try To launch It Ussing "ShellExecute()"
But When Launch it, Skype Takes the 99 % of CPU.
There is the code that Im Ussing

Hwnd:=Application.Handle; //Handle Application
reg:=TRegistry.Create; //Registry Unit, to get Access to the Registry
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKeyReadOnly('\SOFTWARE\Skype\Phone');
aux:=Reg.ReadString('SkypePath'); //Gets the Path Where is installed Skype
Reg.CloseKey;//Close Registry
If (Aux<>'') and (FileExists(aux)) then begin
if not IsFileActive('Skype.exe') then
//That Line Can Be Excluded, if Is already running only open the GUI with out any problem

ShellExecute(hwnd,'Open',Pchar(aux),'','',SW_NORMAL);
//have Try To launch it Whith out Handle and the Same Issue

end else If MessageDlg('Skype does not Installed, Want Visit the WebSite',mtConfirmation,[mbyes,mbno],0)=ID_yes then
ShellExecute(Hwnd,'Open',Pchar('http://www.skype.com/'),'','',SW_MAximize);

Do You have any Idea?! crying.png
Thanks and Regards
henrik gustav
hi im no expert in win api, but is it possible to use POST/SEND MESSAGE to execute a program?

QUOTE(Enan0 @ Tue Sep 25 2007, 22:45) [snapback]445202[/snapback]

Hi Guy's, Im Developing with:
Delphi 5
SKYPE4COMLib_TLB Imported From (Skype4COM.dll ver 1.0.27.1)

I have That Issue, I Check If skype are Running in the Machine, If not I try To launch It Ussing "ShellExecute()"
But When Launch it, Skype Takes the 99 % of CPU.
There is the code that Im Ussing

Hwnd:=Application.Handle; //Handle Application
reg:=TRegistry.Create; //Registry Unit, to get Access to the Registry
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKeyReadOnly('\SOFTWARE\Skype\Phone');
aux:=Reg.ReadString('SkypePath'); //Gets the Path Where is installed Skype
Reg.CloseKey;//Close Registry
If (Aux<>'') and (FileExists(aux)) then begin
if not IsFileActive('Skype.exe') then
//That Line Can Be Excluded, if Is already running only open the GUI with out any problem

ShellExecute(hwnd,'Open',Pchar(aux),'','',SW_NORMAL);
//have Try To launch it Whith out Handle and the Same Issue

end else If MessageDlg('Skype does not Installed, Want Visit the WebSite',mtConfirmation,[mbyes,mbno],0)=ID_yes then
ShellExecute(Hwnd,'Open',Pchar('http://www.skype.com/'),'','',SW_MAximize);

Do You have any Idea?! crying.png
Thanks and Regards

Enan0
QUOTE(henrik gustav @ Wed Sep 26 2007, 07:30) [snapback]445300[/snapback]

hi im no expert in win api, but is it possible to use POST/SEND MESSAGE to execute a program?


Post/SEND? For What? Sorry.
But Im Trying to Execute Skype in the Local machine. I have Try to do With

WinExec() and I get the Same Issue.

awahlig
Maybe you should try using the skype.Client.IsRunning() and skype.Client.Start() methods of Skype4COM.

Both documented here:
https://developer.skype.com/Docs/Skype4COMLib/IClient
Enan0
Thanks I will take a look.


QUOTE(awahlig @ Wed Sep 26 2007, 22:00) [snapback]445611[/snapback]

Maybe you should try using the skype.Client.IsRunning() and skype.Client.Start() methods of Skype4COM.

Both documented here:
https://developer.skype.com/Docs/Skype4COMLib/IClient



awahlig, Thanks For the Info, I have Use The mothod comented, Skype Is launched But the Result Is the Same. Takes the 99% of CPU.
Enan0
Im Not Sure. But Can Be a Bug Of Skype and delphi 5?, because I have try to launch using VB, and It Works Fine.
I mean Skype Does not Take the control of the CPU several times.
Enan0
Ok If I do In Delphi 6 Works Perfect!!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.