[API]
GetWindowTextA
GetWindowTextW

[INCLUDE]
TemporaryMemory
PeekS

[CODE]
Public Function GetWindowText(ByVal hwnd As Long) As String
  If IsUnicode Then
    hwnd = GetWindowTextW(hwnd, ByVal ptrTemp, ptrTempSizeXW)
    Else
    hwnd = GetWindowTextA(hwnd, ByVal ptrTemp, ptrTempSizeX)
    End If
  GetWindowText = PeekS(ptrTemp, hwnd)
  End Function
