由于我的我系统启动比较慢,我想在系统运行的时候,先出现一个提示“系统加载中信息”,然后再进入我的系统,不知道有谁这方便的经验,能帮助我一下,在等待中、、、、、、

解决方案 »

  1.   

    Delphi--软件启动画面中启动状态的显
    在flashfrm窗體中
    unit flash;
    interface
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
     Dialogs, ExtCtrls, StdCtrls, Gauges;
    type
      TFlashfrm = class(TForm)
     Image1: TImage;
       Gauge1: TGauge;
       Label1: TLabel;
       procedure FormCreate(Sender: TObject);
      private
       { Private declarations }
        procedure RepaintForm;
     public
       { Public declarations }
       procedure BeginLoad;
       procedure EndLoad;
       procedure UpdateLoadStatus(const AStatusText: string; AProgress: Integer);  end;
    var
      Flashfrm: TFlashfrm;
    implementation
    {$R *.dfm}
    procedure tFlashfrm.BeginLoad;
    begin
     label1.Caption := '正在初始化程序...';
         Gauge1.Progress := 0;
         RepaintForm;
    end;procedure tFlashfrm.EndLoad;
    begin
     label1.Caption := '初始化完成';
      Gauge1.Progress := 100;
      RepaintForm;
    end;
    procedure tFlashfrm.RepaintForm;
    begin
      Show;  Update;  Sleep(500);
    end;
    procedure tFlashfrm.UpdateLoadStatus(const AStatusText: string; AProgress: Integer);
    begin
      label1.Caption := AStatusText;
      Gauge1.Progress := AProgress;   Sleep(500);
      RepaintForm;
    end;
    procedure TFlashfrm.FormCreate(Sender: TObject);
    begin
      label1.Caption := '';
       Gauge1.MinValue := 0;
      Gauge1.MaxValue := 100;
    end;
    end.
    在dpr窗體中(F8進入)
    program Flashexe;
    uses
      Forms,
      Windows,
      Controls,
      Messages,
      flash in 'flash.pas' {Flashfrm},
      Main in 'Main.pas' {Mainfrm},
      frm1 in 'frm1.pas' {Frmfrm1};
    {$R *.res}
    var
      hMutex: THandle;
      FoundWnd: THandle;
      ModuleName: string;function EnumWndProc(hwnd: THandle; Param: Cardinal): Bool; stdcall;
    var
      ClassName, WinModuleName: string;
      WinInstance: THandle;
    begin
      Result := True;
      SetLength(ClassName, 100);
      GetClassName (hwnd, PChar (ClassName), Length (ClassName));
      ClassName := PChar(ClassName);
      if ClassName = Tmainfrm.ClassName then
      begin
        SetLength(WinModuleName, 200);
        WinInstance := GetWindowLong(hwnd, GWL_HINSTANCE);
        GetModuleFileName (WinInstance, PChar (WinModuleName),
          Length(WinModuleName));
        WinModuleName := PChar(WinModuleName);
        if WinModuleName = ModuleName then
        begin
          FoundWnd := Hwnd;
          Result := False;
        end;
      end;
    end;begin
      HMutex := CreateMutex(nil, False, 'OneCopyMutex');
      if WaitForSingleObject(hMutex, 0) <> WAIT_TIMEOUT then
      begin
      Application.Initialize;
      Flashfrm := tFlashfrm.Create(nil);
        try
          with Flashfrm do
          begin
            BeginLoad;
            Application.CreateForm(TMainfrm, Mainfrm);
            // 加載窗體
            UpdateLoadStatus('正在加載模塊1......', 10);
            // 加載窗體
            Application.CreateForm(TFrmfrm1, Frmfrm1);
            UpdateLoadStatus('正在加載模塊2......', 40);
            // 加載窗體
            UpdateLoadStatus('正在加載模塊3......', 60);
             // 加載窗體
            UpdateLoadStatus('正在加載模塊4......', 70);
             // 加載窗體
            UpdateLoadStatus('正在加載模塊5......', 80);
             // 加載窗體
            UpdateLoadStatus('正在加載模塊6......', 90);
             // 加載窗體
            Flashfrm.EndLoad;
          end;
        finally
          Flashfrm.Free;
        end;
        Application.Run;
      end
      else
      begin
        SetLength(ModuleName, 200);
        GetModuleFileName (HInstance, PChar(ModuleName), Length (ModuleName));
        ModuleName := PChar(ModuleName);
        EnumWindows(@EnumWndProc, 0);
        if FoundWnd <> 0 then
        begin
          if not IsWindowVisible(FoundWnd) then
            PostMessage(FoundWnd, wm_App, 0, 0);
          SetForegroundWindow(FoundWnd);
        end;
      end;
    end.
      

  2.   

    窗体设置为bsnoe,放一张图片,一个timer,timer的时间由你设,事件写timer.enabled:=false;close;工程文件里写:
    FrmInit:=TFrmInit.Create(FrmInit);
      FrmInit.ShowModal;
    Application.CreateForm(TFrmMain, FrmMain);
      Application.Initialize;
      Application.Run;
      

  3.   

    启动界面最好放到主窗体的formcreate里面去操作,初始化完成后关闭就可以了
      

  4.   


    procedure TMainFrm.FormCreate(Sender: TObject);
    begin
      //GetConfigInfo1;
      try
        LogonFrm:=TLogonFrm.Create(Application);
      finally
        LogonFrm.ShowModal;  //登录窗体,
       // if (ClientMyUser.cUserCode<>'') and (ClientMyUser.cPassWord<>'') then
        begin
          try
            Flashfrm := TFlashfrm.Create(Application);
            Flashfrm.Show;        //启动界面,初始化的一些操作可以在他的里面做
            sleep(3000);
             .....//初始化的操作也可以加到这里吧
          finally
            FreeAndNil(Flashfrm);
          end;
        end;
        FreeAndNil(LogonFrm);
      end;
    end;说明:MainFrm是系统的主窗体.你找找以前的帖子吧,应该不少的.
      

  5.   

    打开dpr文件的代码
    begin
      Splasher:=TSplasher.Create(Application);
      Splasher.Show;
      Splasher.Update;
      Application.Initialize;
      Splasher.lblStatupInfo.Caption:='正在连接服务器,请稍后……';
      Splasher.Update;
      Application.Title := 'xxxxxx';
      Application.CreateForm(TdataMdl, dataMdl);
      Splasher.Update;
      if DataMdl.conComm.Connected then begin
        Application.CreateForm(TMainform, Mainform);
      end;
       Splasher.Free;
       Application.Run;
    end.
      

  6.   

    加进度条的办法:
    在工程启动的过程中,每加载一个窗体,就修改进度条然后刷新Splash窗体。