joseLB Posted February 3, 2007 Posted February 3, 2007 I posted a tread with an idea on how to solve with au3 the skype problem of to not send a message when both parties are not logged in. http://www.autoitscript.com/forum/index.php?showtopic=40434question: do that, I need to know how to access skype API and send commands to it, as up to now nobody is candidate to make this program. Can you help with some examples and/or explanation?Jose
Pakku Posted February 3, 2007 Posted February 3, 2007 try it here:http://forum.skype.com/Arjan How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and backCalculate PiCommand line downloader (Youtube/Google video)Set the transparency of a window just by hitting a key!Secure your pcOther things:My filemanMy profilePM me
tomtomtom Posted December 21, 2007 Posted December 21, 2007 I posted a tread with an idea on how to solve with au3 the skype problem of to not send a message when both parties are not logged in. http://www.autoitscript.com/forum/index.php?showtopic=40434question: do that, I need to know how to access skype API and send commands to it, as up to now nobody is candidate to make this program. Can you help with some examples and/or explanation?JoseJose asked this question nearly a year ago. Apparently, at the time, nos sample scripts were made available. I still think that this is a very interesting topic. Can anyone please help with a sample script?
ptrex Posted December 22, 2007 Posted December 22, 2007 @All It's not what you need but it's a start. ; Skype MultiUser Chat ; Create a Skype4COM object: $oSkype = ObjCreate("Skype4COM.Skype") If Not $oSkype.Client.IsRunning Then $oSkype.Client.Start() EndIf ; Create a UserCollection object and add the multichat users to this collection: $oMembers = ObjCreate("Skype4COM.UserCollection") $oMembers.Add($oSkype.User("skypeuser1")) $oMembers.Add($oSkype.User("skypeuser2")) $oMembers.Add($oSkype.User("skypeuser3")) ; Create a multichat: $oChat = $oSkype.CreateChatMultiple($oMembers) ; Open a chat window: $oChat.OpenWindow() ; Set a chat topic: $oChat.Topic = "Skype is cool" ; Send a chat message: $oMsg = $oChat.SendMessage("Greetings!") ; Leave a chat: $oChat.Leave regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
tomtomtom Posted December 24, 2007 Posted December 24, 2007 @All It's not what you need but it's a start. ; Skype MultiUser Chat ; Create a Skype4COM object: $oSkype = ObjCreate("Skype4COM.Skype") If Not $oSkype.Client.IsRunning Then $oSkype.Client.Start() EndIf ; Create a UserCollection object and add the multichat users to this collection: $oMembers = ObjCreate("Skype4COM.UserCollection") $oMembers.Add($oSkype.User("skypeuser1")) $oMembers.Add($oSkype.User("skypeuser2")) $oMembers.Add($oSkype.User("skypeuser3")) ; Create a multichat: $oChat = $oSkype.CreateChatMultiple($oMembers) ; Open a chat window: $oChat.OpenWindow() ; Set a chat topic: $oChat.Topic = "Skype is cool" ; Send a chat message: $oMsg = $oChat.SendMessage("Greetings!") ; Leave a chat: $oChat.Leave regards ptrex Thank you very much, ptrex. I am new to Autoit and, and frankly, I am also new to object oriented programming. I am old and oldfashioned. But I am still trying to learn and your example will help me to learn. And it will certainly keep me busy for a while. Thanks again. TomTomTom
ptrex Posted December 24, 2007 Posted December 24, 2007 @tomtomtom You are welcome !! Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
tomtomtom Posted December 24, 2007 Posted December 24, 2007 Sorry to bother (and possibly bore) again. I have been reading: https://developer.skype.com/Docs/ApiDoc/Skype_API_on_Windows. Just one page, I have copied/pasted it below. I have trying to implement this in Skype. It is rather basic, I think. It is about sending/receiving messages to and from Skype. I imagine that it can be done trough Autoit functions such as DLLCall or other AutoIT functions? Would anybody help me please? Thank you in advance. Tomtomtom.This is the text from the "skype developer zone":Skype API on WindowsWhen developing applications to work with Skype, follow these general guidelines: Give intuitive names to executable files (.exe files) because this name is displayed to the user for confirmation. If the name is unclear, the user might not allow the application to access Skype. Sign applications with VeriSign's CodeSigning certificate. The application must support the NAME command and publish its name. Skype for Windows sends and receives API commands using WM_COPYDATA messages. Use the RegisterWindowMessage method to register the following messages: SkypeControlAPIDiscover SkypeControlAPIAttach To initiate communication, a client application broadcasts the SkypeControlAPIDiscover message, including its window handle as a wParam parameter. Skype responds with a SkypeControlAPIAttach message to the specified window and indicates the connection status with one of the following values: SKYPECONTROLAPI_ATTACH_SUCCESS = 0 - The client is attached and the API window handle is provided in wParam parameter. SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION = 1 - Skype acknowledges the connection request and is waiting for user confirmation. The client is not yet attached and must wait for the SKYPECONTROLAPI_ATTACH_SUCCESS message. SKYPECONTROLAPI_ATTACH_REFUSED = 2 - The user has explicitly denied access to client. SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE = 3 - The API is not available at the moment, for example because no user is currently logged in. The client must wait for a SKYPECONTROLAPI_ATTACH_API_AVAILABLE broadcast before attempting to connect again. When the API becomes available, Skype broadcasts the SKYPECONTROLAPI_ATTACH_API_AVAILABLE = 0x8001 message to all application windows in the system. The data exchange uses commands (or responses), provided as null-terminated UTF-8 strings. The terminating 0 must be transferred as well. You cannot combine several messages in one packet. There is no limit to the length of the transferred string. Note: The result of processing the message must be different from zero (0), otherwise Skype considers that the connection broken. If the API client spends more than 1 second processing a message, the connection is disconnected. Use the PING command to test the connection status. To ease debugging during development, in regedit enter the key APITimeoutDisabled (DWORD value, 0 = timeout enabled 1 = timeout disabled) into the HKCU\Software\Skype\Phone\UI file in the registry to override the 1 second timeout. To check if Skype is installed, in regedit check if the following key exists: HKCU\Software\Skype\Phone, SkypePath . This key points to the location of the skype.exe file . If this key does not exist, check if the HKLM\Software\Skype\Phone, SkypePath key exists. If the HKCU key does not exist but the HKLM key is present, Skype has been installed from an administrator account but not been used from the current account.
tomtomtom Posted December 28, 2007 Posted December 28, 2007 At the cost of some sweat, I think that I have found a partial answer to my own question. See the code below. My script now actually talks to Skype. I can see that, because Skype is asking permission to interact with my AutoIt program. However: this is only a beginning. Can somebody please give me a hint about the next step? Skype is supposed to return a SkypeControlAPIAttach message. How can I detect that that has actually happened? Please? This is my script so far: CODE #include <misc.au3> #include <constants.au3> #include <GUIConstants.au3> Const $HWND_BROADCAST = 0xFFFF $gui = GUICreate("Sender", 300, 150) GUISetState() $SkypeControlAPIDiscover = DllCall('user32.dll', 'int', 'RegisterWindowMessage', 'str', "SkypeControlAPIDiscover") $SkypeControlAPIDiscover = $SkypeControlAPIDiscover[0] $SkypeControlAPIAttach = DllCall('user32.dll', 'int', 'RegisterWindowMessage', 'str', "SkypeControlAPIAttach") $SkypeControlAPIAttach = $SkypeControlAPIAttach[0] $hwndS = WinGetHandle("Sender") DllCall("user32.dll","int","SendMessage","hwnd",$HWND_BROADCAST , "int",$SkypeControlAPIDiscover,"int",$hwndS, "int",0)
tomtomtom Posted December 31, 2007 Posted December 31, 2007 A step forward: now I get a response from Skype. See the code below. Not even a tiny step for mankind but a major triumph for me! I'll stop boring you with this now. Thanks for reading all this. Tom CODE#include <misc.au3> #include <constants.au3> #include <GUIConstants.au3> Const $HWND_BROADCAST = 0xFFFF $gui = GUICreate("Sender", 300, 150) $SkypeControlAPIDiscover = DllCall('user32.dll', 'int', 'RegisterWindowMessage', 'str', "SkypeControlAPIDiscover") $SkypeControlAPIDiscover = $SkypeControlAPIDiscover[0] ; $SkypeControlAPIAttach = DllCall('user32.dll', 'int', 'RegisterWindowMessage', 'str', "SkypeControlAPIAttach") $SkypeControlAPIAttach = $SkypeControlAPIAttach[0] ; Run("C:\Program Files\Skype\Phone\Skype.exe") WinWaitActive("Skype") $hwnd = WinGetHandle("Skype") ; $Ret = DllCall("user32.dll","int","SendMessage","hwnd",$HWND_BROADCAST , "hwnd",$SkypeControlAPIDiscover,"hwnd",$gui, "int",0) ; ; ; GUIRegisterMsg($SkypeControlAPIAttach,"attach") GUISetState() ; While GUIGetMsg() <> $GUI_EVENT_CLOSE wend exit ; ; func attach() MsgBox("1","attached", "attached") EndFunc
ptrex Posted December 31, 2007 Posted December 31, 2007 @Tom Nice to see you get something going. I suggest that you post the things that work on the Example section. This makes your script last longer. Keep up the good work. Regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
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