>I know this is an easy one for the experienced among you, but to us neophytes it's not always easy to come up with the answer.
>
>Question... After compiling your project, how do you stop the VFP window from showing up in the background?
>
>Thank you,
>Rich Murillo
There are a few settings that need to be done for a desktop application to work.
In the project there needs to be a textfile (I usually call it config.fpw) with a few settings that are in effect on program start, before the actual code is running:
KEYCOMP=WINDOWS
CODEPAGE=AUTO
COLLATE=GENERAL
DATE=American
HOURS=24
RESOURCE=OFF
SCREEN=OFF
TITLE=Sample application
ICON=Sample.ico
Secondly in your main.prg you would also set the _SCREEN off, but if you are in devmode make it visible again after running the code, so you get back to the project manager. In runtime you would let the program quit:
_SCREEN.Caption = "Sample"
_SCREEN.Icon = "Sample.ico"
_SCREEN.Visible = .F.
CLEAR
CLEAR ALL
SET RESOURCE OFF
SET EXCLUSIVE OFF
SET TALK OFF
SET NOTIFY OFF
SET DATE American
SET SAFETY OFF
SET DEFAULT TO (JUSTPATH(SYS(16)))
LOCAL llDevMode
llDevMode = (VERSION(2) == 2)
DO FORM Form1
READ EVENTS
IF m.llDevMode
MODIFY PROJECT Sample.pjx NOWAIT
ENDIF
RETURN .T.
The form (or better formclass) would need to be set ShowWindow=2 && As Top-Level Form
In the Destroy event of the form you enter the following line:
CLEAR EVENTS
Thanks Christian. All you guys have been so helpful.
The _screen.visible=.f. did it for me.