interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private declarations } protected procedure WMNCHitTest(var M: TWMNCHitTest); message WM_NCHitTest; public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.WMNCHitTest(var M: TWMNCHitTest); begin inherited; //继承原有的消息处理函数 if M.Result = htClient then //判断消息结果是否htClient,是则将此结果改成htCaption M.Result := htCaption; end; end.