Help - Search - Members - Calendar
Full Version: Detecting Skype running or not
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
MrTAToad_
Hello

Does anyone have a good way of detecting (in C) a good way of detecting whether Skype is not running (but is installed). The problem is that SendMessage returns a valid value even if Skype isn't running.
bonbons_
QUOTE(MrTAToad)
Hello

Does anyone have a good way of detecting (in C) a good way of detecting whether Skype is not running (but is installed).  The problem is that SendMessage returns a valid value even if Skype isn't running.

If I remeber well, the first step is to broadcast a message to find the running Skype... and if you don't get any answer, then skype is NOT running. (Broadcast to be able to get the Window Handle of the Skype API window)
To check if Skype is installed there is a registry key you can check.
MrTAToad_
Ah, so the two SendMessages are needed. Thanks.

Its certainly a very painful system that Skype decided to implement - what was wrong with using library files & headers ?
bonbons_
QUOTE(MrTAToad)
Ah, so the two SendMessages are needed.  Thanks.

Its  certainly a very painful system that Skype decided to implement - what was wrong with using library files & headers ?

With this it's possible to add functionality without any need to recompile for the client. With scripting bindings this means, bindungs written once, scripts written anytime!

For Skype also this is easier. Nearly everything about synchronization is managed by the Window Message System of the OS.

First PostMessage() to find Skype, then SendMessage(WM_COPYDATA) to use the API!
artyomt_
check out named objects with ProcessExplorer (mutexes to be precise). I'm sure you find out then how determine Skype running or not. Named mutex is a common practice to impement singleton pattern for running application.

cheerz cool.png
taavet_
The basic way for detecting if Skype is installed, but NOT running is the following:

How to detect Skype:
To see if Skype is installed check the following registry key: HKCUSoftwareSkypePhone 'SkypePath'. The key will point to the location of skype.exe. In case that key is missing the application should also check for existance of HKLMSoftwareSkypePhone 'SkypePath' (if HKCU is missing but HKLM is present it indicates that skype has been installed from an administrator account, but not yet used from current account).
Collection_
One possibility could be using delphi:

CODE
function IsRunning: Boolean;

var

 Handle: Cardinal;

begin

 Handle := CreateMutex(nil, True, 'SkypeMutex');

 Result := (GetLastError = ERROR_ALREADY_EXISTS);

 if Handle <> 0 then CloseHandle(Handle);

end;
nielm_
... or you could look for the SkypeWindowClass using the FindWindowEx() win32 api call...
hTestWin=FindWindowEx(NULL,NULL,"SkypeWindowClass",NULL);
ppmotskula
on debian-based linux distros, dpkg -l skype lets you know whether the package is installed (read man rpm or man yum for other package managers), and ps x | grep skype tells you if it's running or not.
nsperumal_
Can anyone tell me how to check whether skype is running or not in a remote system ?
ppmotskula
[quote=nsperumal]Can anyone tell me how to check whether skype is running or not in a remote system ?[/quote]Skype is just another application. So you need appropriate access to that remote system to make sure whether Skype (or any other app) is running or not. Unless the owner of the remote system hasn't given you access, you're more or less out of luck.

The difference between, say, a web server and a Skype Client is that the webserver is host-specific (ie you can telnet remote.host.name 80 to find out if there is a webserver running or not) but Skype is user-specific.
TheUberOverlord
Try Looking at this C++ code:

http://forum.skype.com/viewtopic.php?t=54549
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.