L
lon911
Unregistered / Unconfirmed
GUEST, unregistred user!
我想和大家讨论一下关于拖放问题,类似于蚂蚁一样,但要比它复杂。<br>我写了一个拖放窗口下面是原代码<br>private<br> { Private declarations }<br> //创建拖放窗口<br> procedure Createparams(Var Params:TCreateParams);override;<br> //拖放窗口的移动<br> procedure WMNCHitTest( var Msg : TWMNCHitTest );message wm_NCHitTest;<br>………………<br>//在窗口上按下鼠标移动窗口<br>procedure TfrmDarg.WMNCHitTest( var Msg : TWMNCHitTest );<br>begin<br> if GetAsyncKeyState(VK_LButton) < 0 then<br> Msg.Result := HTCaption<br> else<br> Msg.Result := HTCLient;<br>end;<br>//创建窗口<br>procedure TfrmDarg.Createparams(var Params:TCreateParams);<br>begin<br> Inherited CreateParams(Params);<br> With Params do<br> begin<br> //Width:=40;<br> //Height:=40;<br> Style :=WS_CAPTION;<br> Style :=WS_POPUP;<br> EXStyle:=ExStyle or WS_EX_TOPMOST;// OR WS_EX_ACCEPTFILES or WS_DLGFRAME or WM_NCHITTEST;<br> WndParent:=GetDeskTopWindow();<br> end;<br>end;<br>这是窗口代码,现在让我们来讨论一下拖放的问题吧!<br><br><br>