>Hi Jess,
>
>That's the same logic that I have, but when it runs as a compiled EXE, the main form is relegated to the background.
>
I'd rely on the Win32 API; grab the hWnd of the Form (you can use the FoxTools functions if you include FOXTOOLS.FLL with your app, or use GetActiveWindow() or FindWindow to snag the hWnd using the Win32API) and then explicitly make the Form the topmost Window by calling the Win32API SetWindowPos() to move the Window to the top of the ZOrder:
DECLARE SetWindowPos IN USER32 ;
INTEGER hWnd, ;
INTEGER hWndInsertAfter, ;
INTEGER X, ;
INTEGER Y, ;
INTEGER cx, ;
INTEGER cy, ;
INTEGER uFlags
#DEFINE HWND_TOP 0
#DEFINE SWP_NOMOVE 2
#DEFINE SWP_NOSIZE 1
#DEFINE SWP_SHOWWINDOW 0x40
=SetWindowPos(hWndForm, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE + SWP_SHOWWINDOW)
BTW, reading the MSDN docs explains in detail why SetForeGroundWindow() doesn't behave as once expected...