>how to use the API fonction EnumWindows to know the top level window ?
You can't in VFP because it requires a callback. Instead, you might want to look at my SpyFoxFox program in the download section. It enumerates all Windows, and that code can be fairly easily modified to return only top-level windows.
If you're only interested in the currently active window then
DECLARE INTEGER GetActiveWindow IN Win32API
lnhWnd = GetActiveWindow()
Will give you the window handle.
George
Ubi caritas et amor, deus ibi est