francesco.j Posted June 20, 2006 Posted June 20, 2006 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 VB6My example is for skype, i have download skype contacts (help and dll to jobwith skype API) from https://developer.skype.com/Download?action...ts-1.0.0.33.zipIn 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 Submy translation in autoit work to make a call:expandcollapse popup#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 WEndbut how i can call function/subroutine Skype_CallStatus like a subrutine? after the dll-call it's possible?please help me!bye Francesco
francesco.j Posted June 20, 2006 Author Posted June 20, 2006 (edited) i have find it! expandcollapse popup#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 June 20, 2006 by francesco.j
abiteric Posted September 18, 2007 Posted September 18, 2007 UP TO TOP i hava same problem~~~ My website about Y-mate 網拍輔助程式 : http://www.L2play.comMy Blog ( Tranditional Chinese ) 開發小組的部落格 : http://tw.myblog.yahoo.com/play19990909
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now