#define GW_OWNER 4 #DEFINE GW_HWNDFIRST 0 #DEFINE GW_HWNDNEXT 2 declare integer GetWindowText in win32api integer, string, integer declare integer GetWindow in win32api integer,INTEGER foxhwnd = _VFP.hWnd hwndNext = GetWindow(foxhwnd,GW_HWNDFIRST) susp **** loop thru each window to search the title DO WHILE hwndNext <> 0 lcBuffer = SPACE(256) lnTitle = GetWindowText(hwndNext,@lcBuffer,256) && get the window text IF lnTitle > 0 lcTitle = LEFT(lcBuffer, lnTitle) ? lcTitle *** check to see if this is the specified window. *.... ENDIF hwndNext = GetWindow(hwndNext,GW_HWNDNEXT) ENDDO>Ok, that worked for Notepad. In my test for my app, I have:
>tcwindow = "Spot Media Tracking System - Kevin Marois" > >lnhwnd = FindWindow(0,tcwindow) > >>