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

Need to avoid loading the MAIN Visual Foxpro window while loading my own form

Status
Not open for further replies.

titoneon

MIS
Dec 11, 2009
335
US
Hello,
i created a little project, that should run a form and be presented on the screen, i just want only my form there, no the default MAIN VISUAL FOXPRO WINDOW and then inside that my form ?
can anyone help me on this or maybe a link to a previous question like this ?
Thanks a lot

 
_screen.visible = .f.

you need to make your form toplevel and showindesktop

Ez Logic
Michigan
 
HI Ez Logic ,
Still shows the Main visual foxpro with no menus but still shows there in white, and my form inside there in the center as i enable center property
Thanks
 
this is the code i ahve in the start up file and i have my form as toplevel and showindesktop
Declare Integer ShellExecute In shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin

Set talk off
SET SYSMENU OFF
set sysmenu to
SET EXCL OFF
SET SAFETY OFF
set century on
SET EXACT on
Application.Visible = .F.
_VFP.Visible = .F.
_SCREEN.Visible = .F.
_screen.windowstate= 2
_screen.visible = .F.

LOCAL lcAppFolder
lcAppFolder = Addbs(Justpath(Sys(16,0)))
SET DEFAULT TO (m.lcAppFolder)
Application.Visible = .T.
DO FORM ADDBS(m.lcAppFolder)+'\cleanrevs'
READ EVENTS
QUIT
 
Why do you have [tt]Application.Visible = .T.[/tt]? The Application object is usually used if you are creating an Automation server. I wonder if that is the cause of your problem. Try taking it out, and see the effect.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
_screen.windowstate= 2

I'll bet that's the culprit. You have correctly made _SCREEN invisible. But the above line maximises the window. It looks like that is overriding the _SCREEN.Visible property.

Try taking that line out, and see what happens.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,
That is exactly the problem, i removed that line, Bingo, you got it thanks a lot, i was a little frustrated and it was that simple line, thanks again
 
You put SCREEN=OFF in config.fpw file and include it into the EXE.

See my faq184-6512

Bye, Olaf.
 
It amazes me how many Foxpro programmers don't know about SCREEN=OFF.

At my current employer, standard instructions for several applications that run unattended all the time were "Start the app and minimize that weird background window" so they found ShowWindow but couldn't figure out the rest of it.

When I started adding config.fpw and turning the main window off it actually got some people mildly confused. "Something is wrong. The background window is missing!" [lipstick]

 
I agree. In fact, the only reason I use a Config.FPW file is to exec[tt]ute SCREEN = OFF[/tt], along with [tt]RESOURCE = OFF[/tt]. Everything else can be handled within the application.

The advantage of using Config.FPW for those two items is that they happen before the screen becomes initially visible (so you don't see the background window "flashing" on and off again), and before the Foxuser files get written.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top