A working example, plus a few changes which you'll want to make use of:
Note that since this is a Windows call, you'll need a delay after the _TITLE to give the OS time to update things to return the proper title for you.
Also note that I'm passing an _OFFSET and not an _INTEGER64.
And you can see the difference in A and W function calls here.
Also notice the STRING * 255 here.
Code: (Select All)
DECLARE DYNAMIC LIBRARY "user32"
FUNCTION GetWindowTextA (BYVAL hWnd AS _OFFSET, lpString AS STRING, BYVAL nMaxCount AS INTEGER)
FUNCTION GetWindowTextW (BYVAL hWnd AS _OFFSET, lpString AS STRING, BYVAL nMaxCount AS INTEGER)
END DECLARE
DIM Dummy AS INTEGER
DIM n AS STRING * 255
_TITLE "This is a test"
Dummy = GetWindowTextA(_WINDOWHANDLE, n, 255)
PRINT n
Dummy = GetWindowTextW(_WINDOWHANDLE, n, 255)
PRINT n
_DELAY .5
Dummy = GetWindowTextA(_WINDOWHANDLE, n, 255)
PRINT n
Dummy = GetWindowTextW(_WINDOWHANDLE, n, 255)
PRINT n
Note that since this is a Windows call, you'll need a delay after the _TITLE to give the OS time to update things to return the proper title for you.
Also note that I'm passing an _OFFSET and not an _INTEGER64.
And you can see the difference in A and W function calls here.
Also notice the STRING * 255 here.