Solved

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

Posted on 2004-04-19
6
192 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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