Hello !
The following code does not work in VFP6 and Win98
After SetWindowText function call the _screen.Caption does not change
Any suggestions please.
Kuido
PROCEDURE sedt
LOCAL hwnd, pol,t1,t2
DECLARE INTEGER GetActiveWindow IN Win32API
DECLARE INTEGER GetWindowText IN Win32API INTEGER hwnd, STRING
@lpString, INTEGER cch
DECLARE INTEGER SetWindowText IN Win32API INTEGER hWnd, STRING lpString
DECLARE INTEGER GetLastError IN Win32API
hwnd = GetActiveWindow()
t1=SPACE(40)
t2=LEN(t1)
t2=GetWindowText(hwnd,@t1,t2)
? "Window Text:", LEFT(t1,t2)
? _screen.Caption
pol="Uus tekst"
t2=SetWindowText(hwnd,pol)
IF t2 > 0
t1=SPACE(40)
t2=LEN(t1)
t2=GetWindowText(hwnd,@t1,t2)
? "Window Text after: ", LEFT(t1,t2)
? _screen.Caption
ELSE
? "ERROR", GetLastError()
ENDIF
RETURN