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

Form inactivated by _SCREEN.visible = .F. 2

Status
Not open for further replies.

bfwriter

Technical User
Jul 22, 2006
35
US
Hello friends,

I have put together a simple calculator Form (with custom functions) for my own use, to be run as an EXE program, on screen, whenever needed.

In order to get rid of the FoxPro screen surrounding the form, I issue _SCREEN.visible = .F. in the Init event of the Form. It gets rid of the VFP screen alright, but initiates the Form in an inactive state (i.e., placing an insertion-point cursor with the mouse activates the form). It's not a lethal flaw, but it's annoying.

The form is Modeless and ShowWindow = 2.

What's going on here?

TIA for any input.
 
The best practice for hiding the SCREEN is to have a config.fpw file (just a text file with a special extension) in your exe and in there have the line SCREEN = OFF.

If you do that and remove the corresponding line from the Init event, it should work properly.

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Many thanks, Mike and Stewart, that fixed it.

However, it leaves me scratching my head, because I had indeed placed the necessary config.fpw file (SCREEN = OFF) in the VFP operating directory, and it simply wasn't effective !!?? That's why I was fiddling with putting it in the Form's Init event. So when you directed me to that as a point of focus, I repositioned my config file to the Form's directory, and included it in the project compile. Now all is well.

Many thanks again.
 
Yes, the config file has to be compiled into the exe in order to work. It doesn't have to be in the form's directory.

Stewart
 
Stewart... config.fpw does not have to be compiled into the EXE.

bfWriter... are you sure you were editing the correct config.fpw? I have several on my drive.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
The config.fpw in fact does not need to be compiled into the EXE, but that's the easiest option.

Otherwise the VFP runtime looks in the EXE directory for a config.fpw file, not in VFPs Home directory or the runtime directory, as a config.fpw is not a general config, but an application config.

And the third way is to use the command-line switch C, more exactly -CFileName, with the filename of a config.fpw right after C. For example:

Code:
C:\Progam Files\YourCompany\Yourapp.EXE -CD:\foxprowindowsconfigfiles\screenoff.fpw

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top