The Code is as follows:
Unit unit1;
Interface
Uses
Windows, messages, sysutils, variants, classes, graphics, controls, forms,
Dialogs, extctrls, menus;
Type
Tform1 = Class (tform)
Panel1: tpanel;
Mainmenu1: tmainmenu;
File1: tmenuitem;
Private
{Private Declarations}
Procedure mymsg (var msg: twmnchittest); message wm_nchittest;
Public
{Public declarations}
End;
VaR
Form1: tform1;
Implementation
{$ R *. DFM}
{$ Apptype console}
Const
Arr: array [-2 .. 21] of string = (
'Reject error ',
'Httransparent ',
'Htnowhere ',
'Htclient-customer region ',
'Htcaption-title ',
'Htsysmenu-system menus ',
'Htgrowbox ',
'Htmenu-menu ',
'Hthscroll-horizontal scroll bar ',
'Htvscroll-vertical scroll bar ',
'Htminbutton-minimization click ',
'Htmaxbutton-maximization click ',
'Htleft-left boundary ',
'Htrig-right boundary ',
'Httop-upper boundary ',
'Httopleft-upper left corner ',
'Httoprig-upper right corner ',
'Htbottom-bottom boundary ',
'Htbottomleft-lower-left corner ',
'Htbottomrig-bottom right ',
'Htborder ',
'Hobject ',
'Htclose-close button ',
'Hthelp ');
{TForm1}
Procedure TForm1.myMsg (var msg: TWMNCHitTest );
Var
I: integer;
Begin
Inherited;
I: = msg. Result;
Writeln (I, arr [I]);
End;
End.
-------------------------------------------
Interface code:
Object Form1: TForm1
Left = 0
Top = 0
Width = 271
Height = 208
AutoScroll = True
Caption = 'wm _ nchittest' #28040 #24687 #28436 #31034
Color = clBtnFace
Font. Charset = DEFAULT_CHARSET
Font. Color = clWindowText
Font. Height =-11
Font. Name = 'tahoma'
Font. Style = []
Menu = MainMenu1
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
Object Panel1: TPanel
Left = 1, 136
Top = 56
Width = 153
Height = 121
Caption = 'panel1'
TabOrder = 0
End
Object MainMenu1: TMainMenu
Top = 16
Object file1: TMenuItem
Caption = 'file'
End
End
End
-------------------------------------------
// A list of all possible values of the Result parameter in the WM_NCHITTEST message is attached:
Ror =-2;
HTTRANSPARENT =-1;
HTNOWHERE = 0;
HTCLIENT = 1;
HTCAPTION = 2;
HTSYSMENU = 3;
HTGROWBOX = 4;
HTSIZE = HTGROWBOX;
HTMENU = 5;
HTHSCROLL = 6;
HTVSCROLL = 7;
HTMINBUTTON = 8;
HTMAXBUTTON = 9;
HTLEFT = 10;
HTRIGHT = 11;
HTTOP = 12;
HTTOPLEFT = 13;
HTTOPRIGHT = 14;
HTBOTTOM = 15;
HTBOTTOMLEFT = $10;
HTBOTTOMRIGHT = 17;
HTBORDER = 18;
HTREDUCE = HTMINBUTTON;
HTZOOM = HTMAXBUTTON;
HTSIZEFIRST = HTLEFT;
HTSIZELAST = HTBOTTOMRIGHT;
Htobject = 19;
Htclose = 20;
Hthelp = 21;
Source code download: http://www.rayfile.com/files/f4da2347-17e5-11df-9f9d-0015c55db73d/