Jump to content

new bye, subroutine (so vb6) and skype!


Recommended Posts

Hi, i'm Francesco and i'm a new bye in autoit!

I have this problem, i want know how i can write subroutine in autoit like VB6

My example is for skype, i have download skype contacts (help and dll to job

with skype API) from https://developer.skype.com/Download?action...ts-1.0.0.33.zip

In the example is a simple VB6 code:

'// Create a Skype4COM object:
 Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")
 
 '// Place a call to echo123:
 Set oCall = oSkype.PlaceCall("echo123")
 
 '// Call status events:
 Public Sub Skype_CallStatus(ByRef aCall, ByVal aStatus)
   WScript.Echo ">Call " & aCall.Id & " status " & oSkype.Convert.CallStatusToText(aStatus)
 End Sub

my translation in autoit work to make a call:

#include <GuiConstants.au3>
#include <Array.au3>

Global $parentWin

$parentWin = GuiCreate("Pirosoft Skype Suite", 1024, 700, -1, -1);crea una finestra 400 x 400
Global $parentWin_Pos = WinGetPos($parentWin, "")

; GUI MESSAGE LOOP
GuiSetState()

;Create a Skype4COM object:
 $oSkype = ObjCreate("Skype4COM.Skype")


;Place a call to echo123:
 $oCall = $oSkype.PlaceCall("echo123")
 
; Call status events:
 Func Skype_CallStatus(ByRef $aCall, $aStatus)
   MsgBox(0, "Call" , "Call " & $aCall.Id & " status " & $oSkype.Convert.CallStatusToText($aStatus) )
 EndFunc

;#####################################################
While 1
    $msg = GUIGetMsg(1)
    
    Select
        
        Case $msg[0]= $GUI_EVENT_CLOSE
        ;MsgBox(0,"You clicked on", "Close")
            If $msg[1] = $parentWin Then
            ;MsgBox(64, "Test", "Parent GUI will now close.")
              ;Switch to the parent window
                GUISwitch($parentWin)
              ;Destroy the parent GUI including the controls
                GUIDelete()             
              ;Exit the script
                Exit
                
            EndIf               
            
    EndSelect       

WEnd

but how i can call function/subroutine Skype_CallStatus like a subrutine? after the dll-call it's possible?

please help me!

bye

Francesco

Link to comment
Share on other sites

i have find it!

#include <GuiConstants.au3>
#include <Array.au3>

Global $parentWin

$parentWin = GuiCreate("Pirosoft Skype Suite", 1024, 700, -1, -1);crea una finestra 400 x 400
Global $parentWin_Pos = WinGetPos($parentWin, "")

; GUI MESSAGE LOOP
GuiSetState()

;Create a Skype4COM object:
 $oSkype = ObjCreate("Skype4COM.Skype")
 $SinkObject=ObjEvent($oSkype,"Skype_") 

;Place a call to echo123:
 $oCall = $oSkype.PlaceCall("echo123")
 
; Call status events:
 Func Skype_CallStatus($oCall, $Status)
   MsgBox(0, "Call" , "Call " & $oCall.Id & " status " & $oSkype.Convert.CallStatusToText($Status))
 EndFunc

;#####################################################
While 1
    $msg = GUIGetMsg(1)
    
    Select
        
        Case $msg[0]= $GUI_EVENT_CLOSE
      ;MsgBox(0,"You clicked on", "Close")
            If $msg[1] = $parentWin Then
          ;MsgBox(64, "Test", "Parent GUI will now close.")
            ;Switch to the parent window
                GUISwitch($parentWin)
            ;Destroy the parent GUI including the controls
                GUIDelete()             
            ;Exit the script
                Exit
                
            EndIf               
            
    EndSelect       

WEnd
Edited by francesco.j
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...