Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Current Window Title
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00216674
Message ID:
00216680
Views:
29
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform