Const Int Wm_nchittest = Zero X 0084 ;
Const Int Htleft = 10 ;
Const Int Htright = 11 ;
Const Int Httop = 12 ;
Const Int Httopleft = 13 ;
Const Int Httopright = 14 ;
Const Int Htbottom = 15 ;
Const Int Htbottomleft = 0x10 ;
Const Int Htbottomright = 17 ;
Protected Override Void Wndproc ( Ref Message m)
{
Base . Wndproc ( Ref M );
Switch (M. msg)
{
Case Wm_nchittest:
Point vpoint = New Point (( Int ) M. lparam & 0 xFFFF ,
( Int ) M. lparam > 16 & 0 xFFFF );
Vpoint = Pointtoclient (vpoint );
If (Vpoint. x <= 5 )
If (Vpoint. Y <= 5 )
M. Result = (Intptr) httopleft;
Else If (Vpoint. Y > = Clientsize. Height - 5 )
M. Result = (Intptr) htbottomleft;
Else M. Result = (Intptr) htleft;
Else If (Vpoint. x > = Clientsize. Width - 5 )
If (Vpoint. Y <= 5 )
M. Result = (Intptr) httopright;
Else If (Vpoint. Y > = Clientsize. Height - 5 )
M. Result = (Intptr) htbottomright;
Else M. Result = (Intptr) htright;
Else If (Vpoint. Y <= 5 )
M. Result = (Intptr) httop;
Else If (Vpoint. Y > = Clientsize. Height - 5 )
M. Result = (Intptr) htbottom;
Break ;< BR >}< br>