TAppEventsOnMessage (Delphi)
Description
This example requires a TApplicationEvents and a TListBox on the form. Select the TApplicationEvents, double-click the OnMessage event and add the following code to the handler. OnMessage is triggered when the application receives a Windows message.
Code
procedure TMainForm.ApplicationEventsMessage(var Msg: tagMSG;
var Handled: Boolean);
begin
lbOnMessage.Items.Add('X:=' + IntToStr(Msg.pt.x) + '|Y:=' + IntToStr(Msg.pt.y));
end;