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

Trouble with exe file, just show one form.

Status
Not open for further replies.

jobsilva

Technical User
Jul 5, 2014
15
MX
Friends, I have created a program that starts with a PRG where I do some settings, then I call up a welcome form and followed a Read Events.
The welcome form has an exit option and I put Clear Events, this form checks if the program is licensed or is an evaluation version and depending on that it calls a configuration form or a main form.
When calling the configuration form or the main form, Read Events is not declared.
I only do it in the startup program.
And I declare Clear Events on every exit button of the program before Quit.
All my forms are top level.
In the main form I also have the function of placing it in the Systray.
But only the welcome form appears, the other forms do not appear.
As if after the welcome form the program was exited.
 
Top level forms can't be modal, so you need another read events.
As if after the welcome form the program was exited.
Is your exe still shown as process in the task manager?

Chriss
 
And,

When calling the configuration form or the main form, Read Events is not declared.
I only do it in the startup program.
And I declare Clear Events on every exit button

How should clear events in all the exit buttons work, when there is no read events?

I'd call the next form from the welcome form and then release it, the READ EVENTS would continue to work for the whole application:
Code:
...do several settings
Do Form welcome && continues with either configuration or main form.
Read Events

The comment becomes quite important. Without it, it looks like the application only shows a welcome form and then exits.


Chriss
 
You don't *HAVE* to call READ EVENTS at all (I don't as a rule), you can just have the initial code call a modal form,
and then make that call others... based on button presses, timers or whatever you like.

Probably not the most elegant or flexible way to work in this modern age, but for process driven applications it works
well enough.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
you can just have the initial code call a modal form, and then make that call others.

The problem with that approach is all the forms in the application will then be modal. In general, any form called by a modal form is itself modal, regardless of the setting of its WindowType property. An application that is entirely modal raises serveral issues in terms of usability.

Another factor is that a welcome screen (aka a splash screen) is usually a top-level form (ShowWindow = 2), and top-level forms can never be modal.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,

Where I use a splash screen that is modal too... with a timer on it to move on from it after a period (and a keyboard check if the user is in a hurry).
Hmm, ShowWindow = 2... maybe one overrides the other?

Not sure how much usability is confined by having forms modal, I did say for apps that are process driven it works well. Perhaps I'm just lucky.

** EDIT ** Just a thought, I haven't developed an entirely new VFP project in a 'couple' of years, except perhaps for 'scanners' to help and monitor
web apps B-)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 

It is actually a small program:

1.- Start with a program.
2.- I call a Welcome form, using a 4 second Timer.
3.- Configuration form, here I ask for location and save it in an Ini file.
4.- With this data I call a web page and get data that I process with a jSon library. It also has the function of stay in Systray. (This is the main form.
5.- Exist one more form for show information and own serial number.

I call a couple tables from where I get some data relevant to the location data provided by the user.

All forms are Top Level (ShowWindow = 2) and all are Mdeless (WindowType = 0) Desktop = .T.
 

jobsilva said:
All forms are Top Level (ShowWindow = 2) and all are Mdeless

That's okay, but points out you need a second READ EVENTS (or keep the first one up, ie don't end the welcome form with CLEAR EVENTS, just release it).
When you use CLEAR EVENTS from the welcome form you return to the main.prg after READ EVENTS.

When you start the next form there, as in my start code example or any other way, as you state these forms are also not modal and so need a new READ EVENTS to keep the EXE process running.

Perhaps it doesn't just seem the EXE exits, perhaps it does.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top