TLama

Untitled

Feb 20th, 2014
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.80 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, cefvcl;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Chromium1: TChromium;
  12.     procedure FormCreate(Sender: TObject);
  13.   private
  14.     FLastURL: string;
  15.     procedure AppMinimized(Sender: TObject);
  16.     procedure AppRestored(Sender: TObject);
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   Form1: TForm1;
  23.  
  24. implementation
  25.  
  26. {$R *.dfm}
  27.  
  28. procedure TForm1.FormCreate(Sender: TObject);
  29. begin
  30.   Application.OnMinimize := AppMinimized;
  31.   Application.OnRestore := AppRestored;
  32. end;
  33.  
  34. procedure TForm1.AppMinimized(Sender: TObject);
  35. begin
  36.   FLastURL := Chromium1.Browser.MainFrame.Url;
  37. end;
  38.  
  39. procedure TForm1.AppRestored(Sender: TObject);
  40. begin
  41.   Chromium1.Load(FLastURL);
  42. end;
  43.  
  44. end.
Advertisement
Add Comment
Please, Sign In to add comment