>I want my Foxpro (VP6) program to be running in the background knowing what the title of the window the user is looking at. Can be any other window application
>
>The way I figure it is to have a timer running making API calls every so often to see what window the user is looking at ... but what API?
>
>Any hints ?
>
>Thanks
Hi James,
The following should do what you're looking for:
DECLARE INTEGER GetActiveWindow IN Win32API
DECLARE INTEGER GetWindowText IN Win32API ;
INTEGER hwnd, STRING @lptstr, INTEGER cbmax
lnhWnd = GetActiveWindow()
lctitle = SPACE(200)
lnlen = LEN(lctitle)
lnlen = GetWindowText(lnhWnd, @lctitle, lnlen)
IF lnlen > 0
lctitle = LEFT(lctitle, lnlen)
ENDIF
hth,
George
Ubi caritas et amor, deus ibi est