>Hi, Ed!
>
> WinExec can only run application when ShellExecute allows to do many other things. Though WinExec is more simple in use. And I never thought it is obsolete function. Maybe my Win32API.HLP file is obslete? <g> ;)
>
It is. The following is cut from the MSDN Library docs:
WinExec
The WinExec function runs the specified application.
Note This function is provided only for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function.
>>>Hi, Nadya!
>>>
>>> Read events in TableMaintenance application have no effect if you already have read events in main application. Just because both run in the instance of the same VFP process. When you want to run TableMaintenance correctly, you will need to make starting form in it as modal form. If you cannot edit that application, you can also try to run it as external windows application, if it is possible for you.
>>> Check if aplication is still in memory until it runs. When it finished to run - continue your program. You may do all this using API functions:
>>>
>>>FindWindow - to check that some window still exists
>>>Sleep - to wait some time in loop that checks above
>>>WinExec - to run TableMaintenance as eternal application
>>>
>>>Following is sample:
>>>
>>>
>>>IF WinExec(lcPath + "TableMaintenance.EXE", 1) > 31
>>
>>* WinExec is only there for backwards compatibility - use ShellExecute()
>>* or CreateProcess() instead.
>>
>>
>>> DO WHILE !glShutdown
>>> sleep(100)
>>> IF FindWindow(0, @lcMyWindowCaption) = 0
>>> EXIT
>>> ENDIF
>>> ENDDO
>>>ENDIF
>>>