Возможно, сообщение глушится далее по коду (у вас не видно всего кода WndProc). Вот так работает:
| Код | unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;
type TForm1 = class(TForm) private { Private declarations } protected procedure WndProc(var Message: TMessage); override; end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WndProc(var Message: TMessage); const Cpts: array[WM_LBUTTONDOWN..WM_MBUTTONUP] of String = ('WM_LBUTTONDOWN', 'WM_LBUTTONUP', '', 'WM_RBUTTONDOWN', 'WM_RBUTTONUP', '', 'WM_MBUTTONDOWN', 'WM_MBUTTONUP'); var Point: TPoint; begin case Message.Msg of WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_RBUTTONDOWN, WM_RBUTTONUP: begin Caption := Cpts[Message.Msg]; Point.X := LoWord(Message.lParam); Point.Y := HiWord(Message.lParam); end; end; inherited; end;
end.
|
|