#Include "window9.bi"

#Ifndef UNICODE
Function GetWindowText overload(hwnd As HWND) As String export
	Dim As Integer L=GetWindowTextLength(hwnd)
	Dim As Byte Ptr fbguiTextBuffer = Allocate (L+1)
	SendMessage(hwnd,WM_GETTEXT,L+1,Cast(LPARAM,fbguiTextBuffer))
	Function = PeekS(fbguiTextBuffer)
	DeAllocate (fbguiTextBuffer)	
End Function
Function GetWindowText OverLoad(hwnd as HWND, buf as LPSTR, lenBuf as integer) as Integer Export	
	Return SendMessage(hwnd,WM_GETTEXT,lenBuf,Cast(LParam,buf))
End Function
#EndIf
