Best practice for splash screen

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I am developing a small utility program that must perform a considerable amount of 'background' or 'research' work before it can display any user interface. In general it can take 3-15 seconds to perform all of the work requured before we display any user interface. So we have determined that the utility should have a splash screen to assure the user that the program is executing and will provide results shortly.

I should also note that we are now using Visual Studio 2005 and the utility is written in C#.

Obviously we do not want the splash screen displayed in the same thread as the work that is being performed, since that leads to the standard problems of the contents not being fully populated and not being repainted if the window is obscured and uncovered once more.

So we are left with two basic approaches:

1. Display the splash screen in a second thread and perform the initialization work in the main thread.

2. Display the splash screen in the main thread and launch the initialization work in another thread.

The former requires a loop that makes calls to DoEvents() so that the screen is refreshed in a timely manner. Since the main thread is in control, it is much easier to collect the information from the initialization thread and to control the splash screen thread.

The latter is a bit more awkward to envision, as the initialization thread may be controlled from either the main thread itself or from inside the splash screen form class (more obscure, but...). This approach has the downside of making it a bit more difficult to retrieve information from the initialization thread (but not too difficult) and to determine when the initialization thread is complete.

Is there a best practice or standard model for this activity in managed ..Net utilities?

-ken
.



Relevant Pages

  • Re: Andrew Tanenbaum on emacs
    ... The user control interface is a two way thing. ... The "user interface" to a program is a two way communications ... but a display isnt two way. ... many possible interpretations of the control state of the program. ...
    (comp.emacs)
  • Re: Andrew Tanenbaum on emacs
    ... The user control interface is a two way thing. ... The "user interface" to a program is a two way communications ... but a display isnt two way. ... The mouse has a logical "position" and transducers to send signals to ...
    (comp.emacs)
  • Capture, modify and redisplay of graphic user interface
    ... I am try to capture graphical user interface of any program running on ... Windows then to do something with it and display it ...
    (microsoft.public.development.device.drivers)
  • Re: Outlook and VFP
    ... I'd rather retrieve all required email information from ... ??>> programmatically and display the info in my own user interface, ... Automation to retrieve the information you need. ... You then display that info ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Andrew Tanenbaum on emacs
    ... The user control interface is a two way thing. ... The "user interface" to a program is a two way communications ... but a display isnt two way. ... can be made about several of the common devices associated with ...
    (comp.emacs)