Author | Topic: Skype | |
---|---|---|
Kari | Skype on Fri, 03 Dec 2010 11:51:23 +0100 Phone and messages works fine, but how to check if receiver is in "contact's" ? Tried in many ways but... Function Main(cPara) local oSkype := CreateObject("Skype4COM.Skype", "Skype_") local oUser,oCall,cTo:="echo123",cStatus local cText:='Hallo how are You?' +chr(13)+chr(10) DEFAULT cPara:='Ring' if oSkype=NIL alert("No Skype4Com installed") RETURN nil End If .not. oSkype:Client:IsRunning() oSkype:Client:Start() Endif /* Howt to check if cTo is in contact's?? if ALERT('Not in contact-list') RETURN NIL endif */ do case case cPara='Ring' oCall:=oSkype:PlaceCall(cTo) case cPara='Msg' oSkype:Client:OpenMessageDialog(cTo,ConvToAnsiCP(cText)) endcase oSkype:destroy() RETURN NIL | |
Chris Andries | Re: Skype on Sat, 04 Dec 2010 11:29:10 +0100 Hi, A connection with Skype is on my wishlist. So thanks for posting this little piece of code. I will test with it. You want to see if your 'cTo' is in the contact list of Skype? I was reading some forums, and I saw this oSkype:AsyncSearchUsers(UserName)? Maybe you already tried it? It should return an ID? I read the docs and saw oSkype:searforusers('xxx'). This should return a user collection, which contains one or more user objects. This way it should be possibile to check for the items (users) in that collection? Did you tried this? I will try to find some time to test with it. Best regards, Chris Andries. "Kari" <progex.data.@progex.se> wrote in message news:81d3b8d$42fae455$7ef93@news.alaska-software.com... > Phone and messages works fine, but how > to check if receiver is in "contact's" ? > Tried in many ways but... > > Function Main(cPara) > local oSkype := CreateObject("Skype4COM.Skype", "Skype_") > local oUser,oCall,cTo:="echo123",cStatus > local cText:='Hallo how are You?' +chr(13)+chr(10) > DEFAULT cPara:='Ring' > if oSkype=NIL > alert("No Skype4Com installed") > RETURN nil > End > If .not. oSkype:Client:IsRunning() > oSkype:Client:Start() > Endif > /* Howt to check if cTo is in contact's?? > if > ALERT('Not in contact-list') > RETURN NIL > endif > */ > do case > case cPara='Ring' > oCall:=oSkype:PlaceCall(cTo) > case cPara='Msg' > oSkype:Client:OpenMessageDialog(cTo,ConvToAnsiCP(cText)) > endcase > oSkype:destroy() > RETURN NIL > > | |
Chris Andries | Re: Skype on Sat, 04 Dec 2010 11:35:56 +0100 Hi, In my previous post I wrote: oSkype:searforusers('xxx') This should be: oSkype:searchforusers('xxx'). Regards, Chris. <Chris Andries> wrote in message news:4bf94f55$7e487ff6$81915@news.alaska-software.com... > Hi, > > A connection with Skype is on my wishlist. So thanks for posting this little > piece of code. I will test with it. > > You want to see if your 'cTo' is in the contact list of Skype? > > I was reading some forums, and I saw this oSkype:AsyncSearchUsers(UserName)? > Maybe you already tried it? It should return an ID? > > I read the docs and saw oSkype:searforusers('xxx'). This should return a > user collection, which contains one or more user objects. This way it should > be possibile to check for the items (users) in that collection? Did you > tried this? > > I will try to find some time to test with it. > > Best regards, > Chris Andries. > > > "Kari" <progex.data.@progex.se> wrote in message > news:81d3b8d$42fae455$7ef93@news.alaska-software.com... > > Phone and messages works fine, but how > > to check if receiver is in "contact's" ? > > Tried in many ways but... > > > > Function Main(cPara) > > local oSkype := CreateObject("Skype4COM.Skype", "Skype_") > > local oUser,oCall,cTo:="echo123",cStatus > > local cText:='Hallo how are You?' +chr(13)+chr(10) > > DEFAULT cPara:='Ring' > > if oSkype=NIL > > alert("No Skype4Com installed") > > RETURN nil > > End > > If .not. oSkype:Client:IsRunning() > > oSkype:Client:Start() > > Endif > > /* Howt to check if cTo is in contact's?? > > if > > ALERT('Not in contact-list') > > RETURN NIL > > endif > > */ > > do case > > case cPara='Ring' > > oCall:=oSkype:PlaceCall(cTo) > > case cPara='Msg' > > oSkype:Client:OpenMessageDialog(cTo,ConvToAnsiCP(cText)) > > endcase > > oSkype:destroy() > > RETURN NIL > > > > > > | |
Kari | Re: Skype on Sat, 04 Dec 2010 11:38:15 +0100 Thanks Chris. I think I tried SearcForUser, but will test asyncSearc Then it would bee nice to get "dialogforum" open when calling, as I do with OpenMessageDialog Best regards Kari <Chris Andries> skrev i meddelandet news:4bf94f55$7e487ff6$81915@news.alaska-software.com... > Hi, > > A connection with Skype is on my wishlist. So thanks for posting this > little > piece of code. I will test with it. > > You want to see if your 'cTo' is in the contact list of Skype? > > I was reading some forums, and I saw this > oSkype:AsyncSearchUsers(UserName)? > Maybe you already tried it? It should return an ID? > > I read the docs and saw oSkype:searforusers('xxx'). This should return a > user collection, which contains one or more user objects. This way it > should > be possibile to check for the items (users) in that collection? Did you > tried this? > > I will try to find some time to test with it. > > Best regards, > Chris Andries. > > > "Kari" <progex.data.@progex.se> wrote in message > news:81d3b8d$42fae455$7ef93@news.alaska-software.com... >> Phone and messages works fine, but how >> to check if receiver is in "contact's" ? >> Tried in many ways but... >> >> Function Main(cPara) >> local oSkype := CreateObject("Skype4COM.Skype", "Skype_") >> local oUser,oCall,cTo:="echo123",cStatus >> local cText:='Hallo how are You?' +chr(13)+chr(10) >> DEFAULT cPara:='Ring' >> if oSkype=NIL >> alert("No Skype4Com installed") >> RETURN nil >> End >> If .not. oSkype:Client:IsRunning() >> oSkype:Client:Start() >> Endif >> /* Howt to check if cTo is in contact's?? >> if >> ALERT('Not in contact-list') >> RETURN NIL >> endif >> */ >> do case >> case cPara='Ring' >> oCall:=oSkype:PlaceCall(cTo) >> case cPara='Msg' >> oSkype:Client:OpenMessageDialog(cTo,ConvToAnsiCP(cText)) >> endcase >> oSkype:destroy() >> RETURN NIL >> >> > > | |
Kari | Re: Skype on Sat, 04 Dec 2010 13:58:39 +0100 This seems to get focu on Skype dialog oSkype:Client:OpenUserInfoDialog(cTo) oCall:=oSkype:PlaceCall(cTo) Kari | |
Kari | Re: Skype on Tue, 14 Dec 2010 10:07:24 +0100 Since I started this, so this works for me, almost perfect Kari #include "dcdialog.ch" #include "activex.ch" Static FUNCTION SKYPE(cPara,cTo) local oSkype := CreateObject("Skype4COM.Skype", "Skype_") local oUser,oCall,oMySkype,oGroup,aContacts:={},x,y,Z local oUsers,nUsers,oContact,cSkypeName,oGroups ,lBlock,cRet:='' local oBrowse,getlist:={},nPointer:=1,lOk:=.f.,lTrue:=.t. if oSkype=NIL MsgBox("Skype is not installed") RETURN cRet End If .not. oSkype:Client:IsRunning() oSkype:Client:Start(.lTrue,lTrue) //Starts Skyp ifn't started 1st parameter - start Skype in minimized state 2nd parameter - show splash screen Sleep(1000) oStand:=oSkype:Attach(5, lTrue) I don't know if needed?? 1st parameter - protocol number 2nd parameter - whether we should wait for successful response //But still problem if Skype is logged out ?? Endif oGroups := oSkype:groups x := oGroups:count for y = 1 to x oGroup := oGroups:item( y ) oUsers := oGroup:users nUsers := oUsers:Count for z = 1 to nUsers oContact := oUsers:item( z ) cSkypeName := oContact:handle lBlock:=oContact:ISblocked if !empty(oContact:Fullname) .and.; !lBlock .and. ascan( aContacts, cSkypename) = 0 aadd(aContacts , { cSkypename, oContact:fullname,oContact:City,; oContact:Country}) endif next next do case case cPara='RingG' Get a user from contactlist, eExpres @ 1,1 DCBROWSE oBrowse DATA aContacts SIZE 130,20 POINTER nPointer; ITEMSELECTED {||lOk:=.t.,DC_ReadGuiEvent(DCGUI_EXIT_OK,getlist)} DCBROWSECOL ELEMENT 1 HEADER 'SkypeName' WIDTH 20 PARENT oBrowse DCBROWSECOL ELEMENT 2 HEADER 'Name' WIDTH 20 PARENT oBrowse DCBROWSECOL ELEMENT 3 HEADER 'City' WIDTH 15 PARENT oBrowse DCBROWSECOL ELEMENT 4 HEADER 'Country' WIDTH 15 PARENT oBrowse @ 22,10 DCPUSHBUTTON CAPTION 'Close' SIZE 10,1; ACTION {||lOk:=.f.,DC_ReadGuiEvent(DCGUI_EXIT_OK,getlist)} DCREAD GUI TITLE 'Skype contactlist' FIT MODAL HANDLER DlgHandler oSkype:destroy() cSkypeName:=if(lOk,aContacts[nPointer,1],cTo) RETURN(cSkypeName) case cPara='RingS' //Phone if aScan(aContacts,trim(cTo))=0 oSkype:Destroy() MsgBox(trim(cTo)+' Not in Your contactlist') RETURN cRet endif oMySkype:=oSkype:CurrentUserHandle oUser:= oSkype:User(cTo) if oMySkype=Trim(cTo) //if not tested errormsg Msgbox('You try to phone Your self!!') oSkype:destroy() RETURN cRet endif oCall:=oSkype:PlaceCall(oUser:handle) oSkype:Client:OpenUserInfoDialog(cTo) endcase oSkype:destroy() RETURN cRet "Kari" <progex.data.@progex.se> skrev i meddelandet news:7149f259$4eb3c1e4$81f89@news.alaska-software.com... > This seems to get focu on Skype dialog > oSkype:Client:OpenUserInfoDialog(cTo) > oCall:=oSkype:PlaceCall(cTo) > > Kari > |