Author: Master Tavi How can I minimize Close the application by rolling my mouse over the system controls Answer: 1 unit Unit1; 2 3 interface 4 5 uses 6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 7 StdCtrls; 8 9 type 10 TForm1 = class(TForm) 11 Button1: TButton; 12 procedure Button1Click(Sender: TObject); 13 procedure FormCreate(Sender: TObject); 14 private 15 procedure lik(var Msg: TWMNCHITTEST); message WM_NCHITTEST; 16 public 17 { Public declarations } 18 end; 19 20 var 21 Form1: TForm1; 22 tx: Boolean; 23 implementation 24 25 {$R *.DFM} 26 27 procedure TForm1.lik(var Msg: TWMNCHITTEST); 28 begin 29 inherited; //respond to other commands 30 if tx = true then //check if it's enabled 31 begin 32 if Msg.Result = Windows.HTMINBUTTON then 33 Application.Minimize 34 else if Msg.Result = Windows.HTCLOSE then 35 Close; //make widows to do it 36 end; 37 end; 38 39 procedure TForm1.Button1Click(Sender: TObject); 40 begin 41 tx := True; //This enables the function 42 end; 43 44 procedure TForm1.FormCreate(Sender: TObject); 45 begin 46 tx := False; //This disables it 47 end; 48 49 end.