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.