type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); {Add this AppMessage here for your OnMessage procedure} procedure AppMessage(var Msg: TMsg; var Handled: Boolean); private { Private declarations } public { Public declarations } end;
...
procedure TForm1.FormCreate(Sender: TObject); begin {you will have to set the OnMessage to a procedure of this form} Application.OnMessage := AppMessage; end;
procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean); begin { ONLY set Handled to True if you want the message to stop here. set it to False at the begining} Handled := False; if Msg.message = WM_QUERYENDSESSION then begin Showmessage(\'Windows Close now...\'); Handled := True; end; end;
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.