怎样实现oicq的窗体(100分)

  • 主题发起人 主题发起人 wzisme
  • 开始时间 开始时间
W

wzisme

Unregistered / Unconfirmed
GUEST, unregistred user!
它没有border,也就是每个窗口最上面的拖动的那个,
它是怎样实现放大和缩小的
 
在Devexpress的组件包里有个OutlookBar,你可以试试
 
它是自定义了WM_NCHITTEST消息的。具体代码如下:
procedure WMNCHITTEST(var m:TWMNCHITTEST);
var
tpclient,tpscreen:TPoint;
ileft,iright,ibottom,itop:integer;
begin

inherited;
tpclient.x:=0;
tpclient.y:=0;
tpscreen:=ClientToScreen(tpClient);
itop:=tpscreen.y;
ibottom:=itop+self.Height;
ileft:=tpscreen.x;
iright:=ileft+self.Width;
if (M.XPos>=iright-3) and (M.YPos>itop+25) and (M.YPos<ibottom-3) and (MainForm.WindowState<>wsMaximized) then
//右边界
M.Result:=HTRIGHT;
if (M.XPos<=ileft+3) and (M.YPos>itop+25) and (M.YPos<ibottom-3) and (MainForm.WindowState<>wsMaximized) then
//左边界
M.Result:=HTLEFT;
if (M.YPos>=ibottom-3) and (M.XPos>ileft+3) and (M.XPos<iright-3)and (MainForm.WindowState<>wsMaximized) then
//下边界
M.Result:=HTBOTTOM;
if (M.XPos>=iright-3) and (M.YPos<=itop+25)and (MainForm.WindowState<>wsMaximized) then
//右上角
M.Result:=HTTOPRIGHT;
if (M.XPos>=iright-3) and (M.YPos>=ibottom-3)and (MainForm.WindowState<>wsMaximized) then
//右下角
M.Result:=HTBOTTOMRIGHT;
if (M.XPos<=ileft+3) and (M.YPos<=itop+25)and (MainForm.WindowState<>wsMaximized) then
//左上角
M.Result:=HTTOPLEFT;
if (M.XPos<=ileft+3) and (M.YPos>=ibottom-3) and (MainForm.WindowState<>wsMaximized) then
//左下角
M.Result:=HTBOTTOMLEFT;


if (M.YPos<MainForm.Top+20) and (M.XPos<(MainForm.Width+MainForm.Left-63)) and (M.XPos>MainForm.Left+25) and (MainForm.WindowState=wsNormal) then

m.result:=htcaption;
if (M.YPos<MainForm.Top+20) and (M.XPos<(MainForm.Width+MainForm.Left-63)) and (MainForm.WindowState=wsMaximized) then

m.Result:=Htmenu;
 
我已经给出代码这么久了,怎么还不给分?????
 
sorry ,枫之叶
最近才看信的
 
后退
顶部