Jack Thanks for your reply. I *can* see what you are getting at and it is a possible approach to look at. MyEXE is being run (i) as a stand-alone EXE or (ii) from within Opera. MyEXE contains Main.PRG which decides what to do (at the moment it's either DO FORM MyForm_TopLevel or DO FORM MyForm_InScreen).
If I had just one form (MyForm - Show in top-level form) and had Main.PRG just call that form, I am not sure whether calling MyEXE from within Opera would work. I'll have to check. The second point is that if I use your approach and MyEXE is run stand-alone them Main.PRG will have to launch a top-level form first in which MyForm can run. As much as I appreciate your suggestion it much just be easier to carry on with my current approach. Perhaps others will have comments - I don't see why ShowWindow needs to be read-only during the Init of the form (obviously it needs to be read-only after that), but I am sure that somebody can throw some light on this (maybe it's something to do with the fact that the form's controls, which are init'd before the form itself, need to know in advance what the ShowWindow of the form is going to be ?) Paul Newton Jack Skelley wrote: > Paul: > Maybe this will help...and maybe you will confused... > I did an app that when the form was called from the main exe the window > state was in a top level form as a global boolean was set in the main exe. > But when the form was called as a stand alone exe the var did not exist > (vartype = U for that boolean) then a background form was launched as > the top level form and then the form that held the data was launched and > the showwindow state stayed the same as 'in a top level form'. As you > know showwindow is read only at run time. A read events was placed in > the activate event method; when called from the main exe the vartype > existed and the read events was from the main form. > When called as a stand alone the clear events was placed in the release > method. > So showwindow state never changed. Only what form was launched for the > stand alone exe form was to appear in. > I hope this did help. > Regards, > > Jack Skelley > > > Paul Newton wrote: > >> Hi all >> >> I have a form which sometimes needs to be displayed as a top-level form >> and at other times in-screen (this depends on whether my EXE which >> contains the form is called as a stand-alone EXE or from within another >> VFP APP/EXE) >> >> At the moment I am storing two identical (well identical except for the >> ShowWindow property) copies of the form (form_toplevel and >> form_inscreen) in the project and compiling the EXE with both forms. >> The "main" program in the EXE decides which of the two form needs to be >> called. >> >> I wondered if there is a better way of dealing with this - I thought >> maybe I could save (one of the) forms as a class and then create either >> a toplevel or inscreen version as required - but I cannot see how to do >> this or even if it is possible (I suspect not) >> >> Thanks >> >> Paul Newton >> >> >> >> [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

