Advertisement
anticlown

rofl

Mar 12th, 2023 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.14 KB | None | 0 0
  1. program rofl;
  2.  
  3. uses
  4.   Vcl.Forms,
  5.   UnitMain in 'UnitMain.pas' {Form1},
  6.   Vcl.Themes,
  7.   Vcl.Styles,
  8.   System.IOUtils,
  9.   System.SysUtils,
  10.   Winapi.Windows;
  11.  
  12. {$R *.res}
  13.  
  14. Var
  15.     Style: String;
  16.  
  17. Procedure Delay(Value: Cardinal);
  18. Var
  19.     F, N: Cardinal;
  20. Begin
  21.     N := 0;
  22.     While N <= (Value Div 10) Do
  23.     Begin
  24.         SleepEx(1, True);
  25.         Application.ProcessMessages;
  26.         Inc(N);
  27.     End;
  28.  
  29.     F := GetTickCount;
  30.  
  31.     Repeat
  32.         Application.ProcessMessages;
  33.         N := GetTickCount;
  34.     Until (N - F >= (Value Mod 10)) Or (N < F);
  35. End;
  36.  
  37. begin
  38.     var Styles := TDirectory.GetFiles('C:\Users\Public\Documents\Embarcadero\Studio\21.0\Styles', '*.vsf');
  39.  
  40.     for Style In Styles Do
  41.     begin
  42.         if not SameText('sky.vsf', ExtractFileName(Style)) Then
  43.             TStyleManager.LoadFromFile(Style);
  44.     end;
  45.  
  46.   Application.Initialize;
  47.   Application.MainFormOnTaskbar := True;
  48.   TStyleManager.TrySetStyle('Sky');
  49.  
  50.     for Style in TStyleManager.StyleNames Do
  51.     begin
  52.       var form := TForm1.Create(Application);
  53.       form.StyleName := Style;
  54.       form.Show;
  55.     end;
  56.     Delay(5000);
  57. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement