What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help] GetWindowText

[help] GetWindowText
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [help] GetWindowText
quote:
Originally posted by Matty
I am not sure if this will work as I am at work not home

code:
function GetWindowText(hWnd){
    var lBuffer = Interop.Call('user32', 'GetWindowTextLengthW', hWnd)+1;
    var sBuffer = Interop.Allocate(2*(lBuffer+2));

    Interop.Call('user32', 'GetWindowTextW', hWnd, sBuffer, lBuffer);

    Debug.Trace('sBuffer: '+sBuffer.ReadString(0));
}

quote:
Originally posted by cirix
The only problem I got now is that its cutting off the last letter but its good enough.
There is the fixed code, all you need to do is add 1 to lBuffer.

This post was edited on 06-29-2006 at 12:19 AM by matty.
06-29-2006 12:17 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[help] GetWindowText - by cirix on 06-28-2006 at 07:17 PM
RE: [help] GetWindowText - by Eljay on 06-28-2006 at 07:30 PM
RE: [help] GetWindowText - by segosa on 06-28-2006 at 07:43 PM
RE: [help] GetWindowText - by cirix on 06-28-2006 at 07:45 PM
RE: [help] GetWindowText - by matty on 06-28-2006 at 08:01 PM
RE: [help] GetWindowText - by cirix on 06-29-2006 at 12:12 AM
RE: [help] GetWindowText - by matty on 06-29-2006 at 12:17 AM


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