Solved

Im unsure how to create a decent "Idle" procedure for delphi for a splash/logon screen

Posted on 2004-04-19
6
190 Views
Last Modified: 2010-04-05
Im trying to use an OnClick event on splash screen as my logon.
The application should open up to the splash screen and wait for the user to click the image on it before it opens up the logon window.
If they then click cancel on logon I want it to just go an sit back at the splashscreen and wait, rather than continue.
If they click OK and the login is fine, I then want the splash to hide and the app to start.

My main issue is with the "Idle" time.
Im not sure how to just make the application sit and do nothing
0
Comment
Question by:mikelittlewood
  • 3
  • 2
6 Comments
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 100 total points
ID: 10858468

   In Project / Options / Auto-create forms remove your application MainForm - let's say it is frmMain and leave only the SplashForm - let's name it frmSplash.

   Close the frmMain on start up and when whe user press Login - then Show it
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10858623
So if I hide the splash screen when they login, and then on the OnClose event of the main form, do frmSplash.Show again to repeat the process

Ill give this a try

Thanks again Ivanov
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10858637
I forgot to mention that I would like it to go back to the splashscreen once they close the frmMain again
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 10858653
In your splash form assign to the OK button the ModalResult mrOK and to Cancel mrCancel....

then in your project file do this:

program Project1;

uses
  Forms,
  uSplashScreen in '..\uSplashScreen.pas' {SplashForm},
  UMAinForm in '..\UMAinForm.pas' {MainForm};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TSplashForm, SplashForm);
  SplashForm.ShowModal;
  If SplashForm.ModalResult <> 1 then halt;
  SplashForm.Free;
  Application.CreateForm(TMainForm, MainForm);
  Application.Run;
end.
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 10858674
--> I forgot to mention that I would like it to go back to the splashscreen once they close the frmMain again

procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
winexec(PChar(ParamStr(0)),SW_ShowNormal);
end;
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 10863086
In the end I used my splash screen to handle the application.
Click on my splash screen image and it opens a logon form.
With a correct logon it hides the splash and then creates my main datamodule and main form.
When I close the main form I just frmSplash.Show again

Seems to work fine (unless there is something I should be careful of that I have forgotten.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question