zoukankan      html  css  js  c++  java
  • DELPHI (VCL及FMX[Firemonkey])启动时的欢迎窗口实现代码

    VCL里面的的实现

    program ZhouFamily;
    
    uses
      Vcl.Forms,
      Winapi.Windows,
      FrmZhouFamilyMainU in 'FrmZhouFamilyMainU.pas' {FrmZhouFamilyMain} ,
      SplashFormU in 'SplashFormU.pas' {SplashForm} ,
      DmU in 'DmU.pas' {DM: TDataModule};
    
    var
      Timestart, timeend: dword;
    
    begin
    
      Application.Initialize;
      Application.MainFormOnTaskbar := True;
      SplashForm := TSplashForm.Create(Application);
      SplashForm.Show;
      SplashForm.Update;
      Timestart := gettickcount;
      Application.CreateForm(TDM, DM); // 数据模块加载
      Application.CreateForm(TFrmZhouFamilyMain, FrmZhouFamilyMain); // 主窗口加载
      timeend := gettickcount;
      if timeend - Timestart < 1000 then
      begin
        sleep(1000 - (timeend - Timestart));
      end;
      SplashForm.Hide;
      SplashForm.Free;
      Application.Run;
    
    end.
    

      

    FMX里面的实现,很不完美,只是为了闪屏而闪屏,因为form的create 事件是在  Application.Run;后才执行的,如果哪位兄弟有好的改进版本,期待能通知下我!

    program ZhouFamily;
    
    uses
      FMX.Forms,
      System.SysUtils,
      FrmZhouFamilyMainU in 'FrmZhouFamilyMainU.pas' {FrmZhouFamilyMain} ,
      SplashFormU in 'SplashFormU.pas' {SplashForm} ,
      DmU in 'DmU.pas' {DM: TDataModule};
    
    {$R *.res}
    
    var
      Timestart, timeend: Tdatetime;
    
    begin
      Application.Initialize;
      SplashForm := TSplashForm.Create(nil);
      Timestart := gettime;
      Application.ProcessMessages;
      Application.CreateForm(TDM, DM);
      Application.CreateForm(TFrmZhouFamilyMain, FrmZhouFamilyMain);
      Application.ProcessMessages;
      timeend := gettime;
      if timeend - Timestart < 1000 then
      begin
        sleep(1000 - trunc(timeend - Timestart));
      end;
      SplashForm.Hide;
      SplashForm.Free;
      Application.Run;
    
    end.
    

      

  • 相关阅读:
    倍增算法2(树上倍增)
    倍增算法1
    可持久线段树
    【BZOJ】1059: [ZJOI2007]矩阵游戏(二分图匹配)
    【BZOJ】2743: [HEOI2012]采花(树状数组)
    【BZOJ】2959: 长跑(lct+缩点)(暂时弃坑)
    【学习笔记】LCT link cut tree
    【学习笔记】FFT
    【BZOJ】1001: [BeiJing2006]狼抓兔子(最小割 / 对偶图)
    【BZOJ】1007: [HNOI2008]水平可见直线(凸包)
  • 原文地址:https://www.cnblogs.com/zhqian/p/2778335.html
Copyright © 2011-2022 走看看