Hi Arthur
Thanks for your reply. The ShellExecute works fine. Its VFP poping to the front thats causing the problem. I have tested further and found that if I call a program, eg DO LoadDoc.prg, which in turn calls the ShellExecute everything is fine
until the program issuing the ShellExecute ends and passes control back to the first program. Then VFP pops to the foreground and becomes the active window.
As long as I stay at the level of the program which issued the ShellExecute then VFP stays in the background. I can test this by calling ShellExecute and then forcing a wait state, eg Inkey(10). When the Inkey ends and control passes back up the line VFP becomes the active window again.
Any thoughts?
Jos
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.