Skype Chat Class Name and GetControlText

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
callmestupid
Newbie
Posts: 3
Joined: Tue May 10, 2011 9:39 pm

Skype Chat Class Name and GetControlText

Post by callmestupid » Tue May 10, 2011 9:59 pm

Hello! Has anyone successfully captured the control text of the Skype ClassName TChatContentControl corresponding to the main chat?

I'm talking about this window:
Image

If you have Skype, could you try to capture text and tell me if it works for you?

I also tried the Skype plugin for Pidgin which looks more promising, but the issue is that the control text of the ClassName assigned to the main chat window is always Pidgin (not "" like the usual ClassName entries).

Or if anyone has a better solution for capturing that text without having to focus Skype, it would be great.

Best regards.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 11, 2011 8:11 am

Doesn't look like it is possible. I looked at the Skype chat control but it does not appear to be exposing the text. So no way to get the text from behind the scenes. May have to use GetTextInRect/GetWindowTextEx instead.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

callmestupid
Newbie
Posts: 3
Joined: Tue May 10, 2011 9:39 pm

Post by callmestupid » Wed May 11, 2011 10:43 am

Hello, Mr. Tettmar. Thanks for the suggestion.

GetWindowTextEx does capture text, but I need not to focus Skype at any time. What I'm doing now instead is using the Skype plugin for Pidgin and reading the Pidgin log file, the only problem is that Pidgin locks the file and Macro Scheduler says it can't open it (though the log file can be viewed in Notepad without problems). If I unlock the file, MS can read it, but Pidgin doesn't log to it anymore.

Is there a way to have MS read the file without conflicting with Pidgin?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed May 11, 2011 12:51 pm

Is there a way to have MS read the file without conflicting with Pidgin?
If Notepad can read the file why not use Notepad?

Code: Select all

//Set the name of your log file to a variable
Let>LogFileName=Drive:\Path\Filename.log




Let>RP_Windowmode=0
Let>RP_Wait=0
Run>Notepad.exe "%LogFileName%"
WaitWindowOpen>Notepad*
Let>WIN_USEHANDLE=1
  GetWindowHandle>Notepad*,Title
  GoSub>MakeOpaque,Title,0
  SetFocus>Title
  Wait>0.1
  Press CTRL
  Send>ac
  Release CTRL
  Wait>0.1
  CloseWindow>Title
Let>WIN_USEHANDLE=0
WaitClipBoard>
GetClipBoard>data


MDL>data




SRT>MakeOpaque
  //constants
  Let>GWL_EXSTYLE=-20
  Let>WS_EX_LAYERED=524288
  Let>LWA_ALPHA=2
  //get style attributes of window
  LibFunc>user32,GetWindowLongA,attribs,MakeOpaque_var_1,GWL_EXSTYLE
  Let>attribs={%attribs% OR %WS_EX_LAYERED%}
  //make window transparent
  LibFunc>user32,SetWindowLongA,swl,MakeOpaque_var_1,GWL_EXSTYLE,attribs
  LibFunc>user32,SetLayeredWindowAttributes,res,MakeOpaque_var_1,0,MakeOpaque_var_2,LWA_ALPHA
END>MakeOpaque

callmestupid
Newbie
Posts: 3
Joined: Tue May 10, 2011 9:39 pm

Post by callmestupid » Wed May 11, 2011 9:16 pm

Hello, JRL!

Thank you for the code, it's indeed a working alternative.
Using Notepad2 now for improved performance.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts