Michel,
Take a look at
Re: SetForegroundWindow behavior frustrating Thread #
786521.
>We have a problem showing the application when we run our EXE. When we run the EXE from VFP, the application starts and we are in the menu. But, when we run it from Windows Explorer by clicking on the EXE, the app starts, we can see it in the Windows task bar but we have to click twice on the Windows task item to switch to it.
>
>I have tried the following after our _screen.Visible=.T.
>
>
>Declare Integer GetActiveWindow In USER32.Dll
>Declare SHORT SetActiveWindow In USER32.Dll Integer HWnd
>LOCAL lnActiveWindow
>lnActiveWindow=GetActiveWindow()
>SetActiveWindow(lnActiveWindow)
>
>
>But, that doesn't help.
>
>Any idea to resolve that issue would be welcome.
--sb--