This is a tip from the late Ed Rauh [MVP]:
DECLARE INTEGER GetActiveWindow IN WIN32API DECLARE INTEGER GetForegroundWindow IN WIN32API DECLARE INTEGER SetForegroundWindow IN WIN32API INTEGER hWnd PRIVATE nMyAppMainHwnd _Screen.Visible = .T. DOEVENTS() nMyAppMainHwnd = GetForegroundWindow()
=SetForegroundWindow(nMyAppMainHwnd)
HTH
|