Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Possible to manipulate a Skype TChatContentControl?


  • Please log in to reply
3 replies to this topic

#1 Herb191

Herb191

    Prodigy

  • Active Members
  • PipPipPip
  • 157 posts

Posted 13 July 2011 - 09:59 PM

I am playing around with Skype and I wanted to see if I could write a small program that would filter incoming and outgoing messages but I am not aware of anyway to interact with a TChatContentControl.







#2 jaberwacky

jaberwacky

    RegExp("\m/")

  • Active Members
  • PipPipPipPipPipPip
  • 3,171 posts

Posted 14 July 2011 - 02:14 AM

Check out this page. I don't have Skype so I haven't tried it.

Edit: Ok, try this code and see what it does. Keep in mind that I don't have Skype so I'm coding blindly here:


Edit: I didn't actually code this. I just converted it to AutoIt.

AutoIt         
#include <WinAPI.au3> Global Const $IID_IAccessible = DllStructCreate("long lData1; integer nData2; integer nData3; byte abytData4[8]") DllStructSetData($IID_IAccessible, 1, 0x618736E0) DllStructSetData($IID_IAccessible, 2, 0x3C3D) DllStructSetData($IID_IAccessible, 3, 0x11CF) DllStructSetData($IID_IAccessible, 4, 0x81, 1) DllStructSetData($IID_IAccessible, 4, 0xC, 2) DllStructSetData($IID_IAccessible, 4, 0x0, 3) DllStructSetData($IID_IAccessible, 4, 0xAA, 4) DllStructSetData($IID_IAccessible, 4, 0x0, 5) DllStructSetData($IID_IAccessible, 4, 0x38, 6) DllStructSetData($IID_IAccessible, 4, 0x9B, 7) DllStructSetData($IID_IAccessible, 4, 0x71, 8) EnumHistory() Func FindWindowEx($parent, $child, $class)     DllCall("User32.dll", "hwnd", "FindWindowEx", "hwnd", $parent, "hwnd", $child, "str", $class, "str", '') EndFunc   ;==>FindWindowEx Func AccessibleObjectFromWindow($hWnd, $obj_id, $riid, ByRef $obj)     Local Const $result = DllCall("Oleacc.dll", "integer", "AccessibleObjectFromWindow", "hwnd", $hWnd, "dword", $obj_id, "integer", $riid, "ptr", $obj)     If IsArray($result) Then         Return $result[0]     Else         Return 0     EndIf EndFunc   ;==>AccessibleObjectFromWindow Func AccessibleChildren($cont, $child_start, $children, ByRef $var_children, ByRef $obtained)     Local Const $result = DllCall("Oleacc.dll", "integer", "AccessibleChildren", "ptr", $cont, "long", $child_start, "long", $children, "ptr", $var_children, "long", $obtained)     If IsArray($result) Then         Return $result[0]     Else         Return 0     EndIf EndFunc Func EnumHistory()     Local $hWnd = FindWindowEx(0, 0, "TskMultiChatForm.UnicodeClass")     Local $hr = "HRESULT"     Local $childCount     Local $WindowObject     Local $accChildren     Local $nReceived     Local Const $OBJID_CLIENT = 0xFFFFFFFC     If $hWnd <> 0 Then         $hWnd = FindWindowEx($hWnd, 0, "TChatBackground")         If $hWnd <> 0 Then             $hWnd = FindWindowEx($hWnd, 0, "TPanel")             If $hWnd <> 0 Then                 $hWnd = FindWindowEx($hWnd, 0, "TPanel")                 If $hWnd <> 0 Then                     $hWnd = FindWindowEx($hWnd, 0, "TChatContentControl")                     If $hWnd <> 0 Then                         $hr = AccessibleObjectFromWindow($hWnd, $OBJID_CLIENT, $IID_IAccessible, $WindowObject)                         If $hr >= 0 Then                             $childCount = $WindowObject.accChildCount                             ReDim $accChildren[$childCount - 1]                             If $childCount > 0 Then                                 $hr = AccessibleChildren($WindowObject, 0, $childCount, $accChildren[0], $nReceived)                                 If $hr >= 0 Then                                     For $i = 0 To $nReceived - 1 ;~                                      If TypeOf $accChildren($i) Is IAccessible Then                                         ConsoleWrite("Found object: " & $accChildren($i).accName(0) & @LF) ;~                                      Else                                         ConsoleWrite("Found object:" & $WindowObject.accName($accChildren($i)) & @LF & @LF) ;~                                      EndIf                                     Next                                 Else                                     ConsoleWrite("Accessible Chilren failed with code: " & $hr & @LF)                                 EndIf                             EndIf                         Else                             ConsoleWrite("AccessibleObjectFromWindow failed with code: " & $hr & @LF)                         EndIf                     Else                         ConsoleWrite("Could not find TChatContentControl" & @LF)                     EndIf                 Else                     ConsoleWrite("Could not find TPanel #2" & @LF)                 EndIf             Else                 ConsoleWrite("Could not find TPanel #1" & @LF)             EndIf         Else             ConsoleWrite("Could not find the TChatBackground class" & @LF)         EndIf     Else         ConsoleWrite("Could not find a chat window" & @LF)     EndIf EndFunc   ;==>EnumHistory

Edited by LaCastiglione, 14 July 2011 - 05:19 PM.


#3 Herb191

Herb191

    Prodigy

  • Active Members
  • PipPipPip
  • 157 posts

Posted 14 July 2011 - 02:36 PM

Thanks LaCastiglione.

Unfortunately it returns a “Could not find a chat window” massage.

#4 GEOSoft

GEOSoft

    Sure I'm senile. What's your excuse?

  • MVPs
  • 10,573 posts

Posted 14 July 2011 - 04:18 PM

You may have a problem with this. If I'm not mistaken Skype was written in Delphi and there are times when it's near impossible to get decent results when trying to automate anything to do with Delphi windows or controls.
Of course now that Microsoft owns Skype that may all change in the not too distant future.
GeorgeQuestion about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else."Old age and treachery will always overcome youth and skill!"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users