What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Change window caption, not with SetWindowText!!!

Change window caption, not with SetWindowText!!!
Author: Message:
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
O.P. Change window caption, not with SetWindowText!!!
I want to change the caption of a chatwindow, where it says who you are talking to (Contact name)
It is just a label, so I can't change it with SetWindowText
But how do I get the handle of this label, and change it?
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-09-2006 11:05 AM
Profile PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Change window caption, not with SetWindowText!!!
You'll have to use Active Accessibility to obtain, not a handle, but an interface to the caption. You can get an IAccessible interface from an HWND, and from that, obtain the IAccessible for the caption. Accessibility Explorer will help you here (it's an MS development tool).
Once you have the caption's IAccessible, I believe the method is called acc_SetText(). As it's a COM interface, it'll require you to pass a BSTR. A hack is to pass a wchar_t pointer, but be warned: as a wchar_t* isn't a fully-defined BSTR, the code may not be perfectly stable.

Of course, if this is going to be entirely in JScript, all strings are BSTR by default ;)
[Image: spartaafk.png]
08-09-2006 02:42 PM
Profile PM Web Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
O.P. RE: Change window caption, not with SetWindowText!!!
@Matty, because I was talking about a ChatWindow, changing the caption in realtime
@RaceProUK could you give me an example, I'm completely lost, or at least a link where I can find 'Accessibility Explorer'
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-09-2006 02:50 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On