Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No luck yet with getting rid of window during exectution... 4

Status
Not open for further replies.

Frank123

MIS
Joined
Sep 17, 2001
Messages
77
Location
US
I'd like to thank everyone for their help so far, but I still didn't achieve my goal of not having a window in the background when I run my executable. I have made the config.fpw and put in the line screen=off, and changed my form to top level form in the properties. For some reason my form will still not show. And I do have the window type as Modal. I'd appreciate any tips. :) Thanks
 
Frank,
First, top-level and Modal are mutually exclusive.
I have a little top level program, it has three files in the project (it doesn't do much <g>):
MAIN.PRG
Myform.scx (and .SCT)
CONFIG.FPW

* MAIN.PRG
SET TALK OFF
set resource off
_VFP.visible = .F.
DO FORM myform
READ EVENTS

IF VERSION(2) <> 0 && not runtime
_VFP.visible = .T.
set resource on
ENDIF

* CONFIG.FPW - this is in Other(tab) - Text Files
SCREEN=OFF

* Myform.scx
* Non-Default Properties
Height = 200
Width = 200
ShowWindow = 2 && as Top-Level Form
AutoCenter = .T.
Caption = &quot;Simulator&quot;

It has one button with Caption property changed to Exit, and the following code in the click event:
CLEAR EVENTS
ThisForm.release()

This works in both the development and runtime environments.

Rick

 
Hi Frank,

I dont think you will succeed in getting rid of the VFP main window. But there is a work around...

In the main forms INIT event.... put the code...
************************************************
WITH _screen
.WindowState=2
.TitleBar=0
.FillStyle=1
.HEIGHT = THISFORM.HEIGHT+12
.WIDTH = THISFORM.WIDTH
.AUTOCENTER = .T.
ENDWITH
THISfORM.TOP=0
THISFORM.LEFT=0
************************************************
The above code will put the main VFP window behind the main form and to its size.

You can go a step further to put the code in the resize event of the form, if the main form is likely to get resized.

Hope this helps you :-)

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :-)
 
HI

When I said,
'I dont think you will succeed in getting rid of the VFP main window. But there is a work around'... I dont want to trigger a controversy.... Technicaly it is possible as RICK specified..
TopLevel Form = .t. (Modal becomes modeless)
Desktop = .t.
After calling the main form.. add the code READ EVENTS in the main.prg.

What I meant is, the way I have put it, you are still using VFP main but still not making it visible to user. So you dont have to change your modal status and so forth...

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :-)
 
Did you set the ShowWindowType to 3 (As top level form) ISO 2 In top level form ?

I have a small app that works like you described (SCREEN=OFF) and it works fine.

Could you maybe post your main code ?

HTH,
Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
Hi, IT IS possible to get rid of the main fox window, and I can send screen shots to prove it. Basically, do as rgbean advises, I set my form to top-level, and modal, I issue screen = off in config.fpw, and in my main startup program I issue application.visible = .f., do my form, and then read-events in that order, and this works.

I think you need version 5 and greater tho....
 
Also make sure the config.fpw is included in your project. Just having at the same location as your EXE does not always do the trick.
-Pete
 
Thanks everyone. I finally got it to work. I did mostly what rgbean told me to do, except I had to add in the tip that ramani gave me which was to change the desktop property to true. Once again you guys have been a great help. Frank
 
RGBean, you are a God to me.
I've been trying to do this since Visual Foxpro 5 was born.

One additional tip for the sake of tidiness:
You can put all of your main program code up to and including the Read Events statement into a startup form's load event and the rest in the activate event.

The &quot;myform&quot; that is called takes control and the startup form never appears. It works beautifully.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top