>>Next to SetForeGroundWindow() etc., perhaps you can handle it internally: if the first.EXE is your own Vfp code, then this might work (assuming _screen.Visible=.T.):
>>
>>
>>With _screen
>> .AlwaysOnTop = !.AlwaysOnTop
>> .AlwaysOnTop = !.AlwaysOnTop
>>EndWith
>>
>>
>>
>>hth
>>-Stefan
>
>Where would this code be placed? At the end of the timer event when it times out?
>
Yes, that sounds good; in other words, at the end of the process that creates the interval you described here:
>>>After 300 seconds, the first EXE needs to come back to the front, but it doesn't.
FWIW, I'd use a timer too if that process runs frequently. If it does not, you can perhaps use the Sleep() function alternatively:
Declare integer Sleep in Win32api integer
Sleep(300*1000)
hth
-Stefan