1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; CheckBox1: TCheckBox; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure CheckBox1Click(Sender: TObject); private smooth_active: boolean; public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject); begin SystemParametersInfo(SPI_GETFONTSMOOTHING, 1, @smooth_active, 0); checkbox1.Checked := smooth_active; end;
procedure TForm1.FormDestroy(Sender: TObject); begin SystemParametersInfo(SPI_SETFONTSMOOTHING, cardinal(smooth_active), nil, 0); end;
procedure TForm1.CheckBox1Click(Sender: TObject); var b : boolean; begin b :=checkbox1.checked; SystemParametersInfo(SPI_SETFONTSMOOTHING, cardinal(b), 0, 0); repaint; end;
end. |