procedure TForm1.WMNCActivate(var Msg: TWMNCActivate); begin inherited; DrawCaptButton; end; procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest); begin inherited; with Msg do if PtInRect(CaptionBtn,Point(xPos-Left,yPos-Top)) then Result:=htCaptionBtn; end; procedure TForm1.WMNCLButtonDown(var Msg: TWMNCLButtonDown); begin inherited; if(Msg.HitTest=htCaptionBtn)then showmessage('成功了!'); end; procedure TForm1.WMNCPaint(var Msg: TWMNCPaint); begin inherited; DrawCaptButton; end; procedure TForm1.WMSetText(var Msg: TWMSetText); begin inherited; DrawCaptButton; end; procedure TForm1.FormResize(Sender: TObject); begin Perform(WM_NCACTIVATE,Word(Active),0); end; end. 仔细研究一下程序中有关计算的几个句子,试着改变某个数字看一看,这将有助于你理解程序。 本文中的程序在Windows98/WindowsMe环境下使用Delphi5/ Delphi6调试通过。 |
正在阅读:在窗口标题区添加按钮在窗口标题区添加按钮
2004-02-14 09:34
出处:电脑爱好者
责任编辑:pjl
键盘也能翻页,试试“← →”键