Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Former Member Absent Member.
Absent Member.
345 views

[archive] Skype

[Migrated content. Thread originally posted on 10 November 2010]

I hope i will find somebody that is kind enought to translate in cobol that code
Thank you!




En VBS l'utilisation de la fonction Create_Object s'impose :

Dim oSkype 'As Skype 'L'objet public Sype


init_Skype
'Appel par exemple de la fen?tre profil de l'utilisateur connect? sur Skype :
oSkype.Client.OpenDialog ("PROFILE")
------------------------------------'
' Init_Skype :
' Fonction d'initialisation Skype permet de lancer le client skype
' si celui-ci ne l'est pas et effectue la "connection" du projet ? l'API Skype.
'--------------------------------------------------'
Sub init_Skype()
Set oSkype = WScript.CreateObject("Skype4COM.Skype",")
If Not oSkype.Client.IsRunning Then
oSkype.Client.Start
End If
While Not oSkype.Client.IsRunning
DoEvents 'Attente d?marrage client Skype
Wend
End Sub






En VBS (code simplifi? en consid?rant que le client Skype est d?j? en route...)
Lecture

Set oSkype = WScript.CreateObject("Skype4COM.Skype","")
'Liste des Amis :
For Each oFriend in oSkype.friends
wScript.Echo oFriend.Handle & vbTab & oFriend.Homepage & vbTab & oFriend.Country & oFriend.LastOnline
next








Effacer un contact en VBScript

Dim stUserAEffacer
Const budDeletedFriend = 1
stUserAEffacer = "toto"
Set oSkype = WScript.CreateObject("Skype4COM.Skype","Skype_")
For Each oFriend in oSkype.friends
if oFriend.Handle = stUserAEffacer Then
oFriend.BuddyStatus = budDeletedFriend
MsgBox stUserAEffacer & " ? ?t? supprim?!"
Wscript.Quit
end if

next
MsgBox stUserAEffacer & " Introuvable !"



Recherche d'un contact en VBScript


Option Explicit
Dim oSkype ' Skype Application
Dim oUser ' User
Dim ucContacts' Collection d'User
Dim stUserAChercher ' string
stUserAChercher = "toto"
Set oSkype = WScript.CreateObject("Skype4COM.Skype","Skype_")
Set ucContacts = oSkype.SearchForUsers(stUserAChercher)
For Each oUser in ucContacts
Wscript.Echo oUser.Handle & " " & oUser.Country & " " & oUser.FullName
next




Const budPendingAuthorization = 2
if ucCOntacts.count = 1 then
ucContacts(1).BuddyStatus = budPendingAuthorization
msgBox "Ajout de " & ucContacts(1).Handle
end if







L'?v?nement MessageStatus en VBScript
Dim oSkype 'As Skype 'L'objet public Sype
const MON_AMI = "toto"
const cmsReceived = 2
init_Skype

Do While True ' boucle sans fin d'attente ?v?nements
WScript.Sleep(60000)
Loop


'
' "Surveillance" des messages de chat
'
Public Sub oSkype_MessageStatus(ByVal pMessage , ByVal Status )
Dim st' As String
Dim stMess' As String
Dim oFso 'As fileSystemObject

If pMessage.FromHandle = MON_AMI And Status = cmsReceived Then
Select Case pMessage.Body
Case "DIR" ' Si commande DIR re?ue renvoi la liste des fichiers..sous C:\
'Creation de la liste de fichiers
Set oFSO = CreateObject("Scripting.FileSystemObject")
For each oFl in oFSO.GetFolder("c:\").Files
stMess = stMess & oFl.name & vbCrlf
Next
'Envoi de la liste de fichiers
pMessage.Chat.SendMessage stMess
Case Else
WScript.Echo ">>Mess>>" & pMessage.Body
End Select
End If
End Sub
'------------------------------------'
' Init_Skype :
' Fonction d'initialisation Skype permet de lancer le client skype
' si celui-ci ne l'est pas et effectue la "connection" du projet ? l'API Skype.
'--------------------------------------------------'
Sub init_Skype()
Set oSkype = WScript.CreateObject("Skype4COM.Skype","oSkype_")
If Not oSkype.Client.IsRunning Then
oSkype.Client.Start
End If
While Not oSkype.Client.IsRunning
DoEvents 'Attente d?marrage client Skype
Wend
oSkype.Attach 'Si l'on doit g?rer des ?v?nements
End Sub
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.