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.