Solved

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

Posted on 2004-04-19
6
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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!

 
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

Industry Leaders: 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

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…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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