January 1, 2005

WinTask - GetWindowText

'
' GetWindowText
'
' Author: Joe Strazzere
'

' "user32" Alias "GetWindowTextA" (
'  ByVal hwnd As Long,
'  ByVal lpString As String,
'  ByVal cch As Long) As Long
'
Dim memptr as unsigned
Dim texlen as unsigned
memptr=allocate(255)
textlen=64
hwnd=GetWindowHandle(focus$(),1)
ret = External("user32","GetWindowTextA", hwnd, memptr, textlen)
mytest$=peekstring$(memptr)
msgbox(mytest$,,"GetWindowText")