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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Invisible

Status
Not open for further replies.

prustie

Programmer
Aug 6, 2001
34
GB
Hi

I have an a bookings application written in VFP 6 under which I want to run a procedure that will be activated every hour and will automatically create and send emails.

I would like this procedure to be completely transparent to the user.

I have created a main prog but as my email generation is in a class I have to call a form. This is running ok using _screen.windowstate and running the form minimised. I have put the code in activate which at the end activates a timer to release the form. I have clear events in the destroy.

However it still causes a flash on the screen when it starts and stops and so having done a search in Tek-Tips I tried creating a CONFIG file with SCREEN=OFF.

Unfortunately although there is no flash the program hangs.

It does the same if I set _screen.visible=.f.

This works from the command line but again the .exe hangs.

Am I missing some simple step?

Any help gratefully received.

Malcolm.
 
Try making your form a Top Level form.

boyd.gif

SweetPotato Software Website
My Blog
 

Malcom,

I'm not clear exactly what you are seeing. Can you actually see the program hanging? If it is invisible, how do you know what is happening?

Perhaps you could clarify what exactly you are doing and what you are seeing.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike

The form shows no sign of operating but from the command window I can see it running on the task bar and then clearing.

The .exe however with SCREEN=OFF does not appear on the task bar. If seems to do the processing but then stops.

If you CTRL-ALT-DEL you can see it is still running.

Malcolm
 

Malcom,

When running in the VFP development environment, it is usual to put _SCREEN.Visible = .T. somewhere near the end of the code. This ensures that the development environment will become visible again when the program finishes. (It's also a good idea to put it in your error handler, if any.)

As far as the EXE is concerned, it sounds as if the CLEAR EVENTS is not getting executed for some reason. I can't see why. If the timer is releasing the form, and the CLEAR EVENTS is in the Destroy, it should work OK.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Rather than making the form invisible, move it off the screen. Set the form's Top to -1000 and ShownInTaskBar to .F. and you have a window that won't ever show up. You'll want it to be a Top-Level Form and set SCREEN=OFF in config.fpw as well.

This also helps in debugging. You can see what the form may be doing if you just change the Top to be positive.

Ian
 
Hi

Thanks for your help everyone.

I tried it again yesterday morning using SCREEN=OFF and running the form minimised and it worked fine.

Don't know what I was doing wrong the day before.

By the way I don't think ShownInTaskBar is in VFP6.

Malcolm.
 
You are correct, ShownInTaskBar was introduced in VFP7. I missed that part of the post. Sorry!

Glad you got it going!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top