×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

RE: No luck yet with getting rid of window during exectution...

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 = "Simulator"

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

RE: No luck yet with getting rid of window during exectution...

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
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: No luck yet with getting rid of window during exectution...

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
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: No luck yet with getting rid of window during exectution...

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:www.crowncap.demon.nl\info\crwnbase
CrownBase source code can be downloaded !!

RE: No luck yet with getting rid of window during exectution...

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....

RE: No luck yet with getting rid of window during exectution...

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

RE: No luck yet with getting rid of window during exectution...

(OP)
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

RE: No luck yet with getting rid of window during exectution...

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 "myform" that is called takes control and the startup form never appears. It works beautifully.

Thanks again.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close