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
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);
    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
sTitle = Interop.Call('User32','GetWindowTextW', playerHwnd, sTitle, 256);
The syntax is incorrect. GetWindowTextW will return a number of the length of the string, not the string itself. That is what the sTitle parameter is for.

This post was edited on 06-28-2006 at 08:13 PM by matty.
06-28-2006 08:01 PM
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