Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run Time Environment
Message
From
21/11/2019 08:10:14
 
 
To
21/11/2019 01:14:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01671964
Message ID:
01671971
Views:
72
>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:
&& Quit all word processes in taskmanager.
_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)))

&& Determine developer mode, if run from PRG or from Exe.
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform