本例效果圖:
wm_nchittest 訊息返回後, 訊息的 result 引數表示了滑鼠所在視窗的部位.
窗體設計步驟: 新建工程後, 隨便新增乙個選單; 設定窗體的 autoscroll 屬性為 true, 並新增乙個 panel 放在合適的位置, 以讓視窗出現滾動條.
unitunit1;inte***ce
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, extctrls, stdctrls, menus;
type
tform1 =
class(tform)
panel1: tpanel;
mainmenu1: tmainmenu;
mnufile: tmenuitem;
private
proceduremymsg(
varmsg: twmnchittest);
messagewm_nchittest;
end;
var
form1: tform1;
implementation
const
arr:
array[-
2..
21]
of
string= (
'hterror'
,
'httransparent'
,
'htnowhere'
,
'htclient - 客戶區'
,
'htcaption - 標題'
,
'htsysmenu - 系統選單'
,
'htgrowbox'
,
'htmenu - 選單'
,
'hthscroll - 水平滾動條'
,
'htvscroll - 垂直滾動條'
,
'htminbutton - 最小化按鈕'
,
'htmaxbutton - 最大化按鈕'
,
'htleft - 左邊界'
,
'htrig - 右邊界'
,
'httop - 上邊界'
,
'httopleft - 左上角'
,
'httoprig - 右上角'
,
'htbottom - 下邊界'
,
'htbottomleft - 左下角'
,
'htbottomrig - 右下角'
,
'htborder'
,
'htobject'
,
'htclose - 關閉按鈕'
,
'hthelp'
);
proceduretform1.mymsg(
varmsg: twmnchittest);
var
i: integer;
begin
inherited;
i := msg.result;
text := format(
'%d: %s'
, [i, arr[i]]);
end;
end.
//另附 wm_nchittest 訊息中 result 引數的所有可能值的列表:
hterror = -
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;
rabbitmq訊息手動確認訊息操作說明
bean public messagerecoverer messagerecoverer rabbittemplate rabbittemplate public class rejectanddontrequeuerecoverer implements messagerecoverer thr...
MFC訊息對映巨集說明
1 declare message map 在標頭檔案中宣告原始檔中所含有的訊息對映 2,begin message map 標記原始檔訊息對映的開始 3,end message ma 標記原始檔訊息對映的結束 4,on command 將特定命令的處理委派給類的乙個成員函式 5,on contro...
常用MFC訊息對映巨集說明
1 declare message map 在標頭檔案中宣告原始檔中所含有的訊息對映 2,begin message map 標記原始檔訊息對映的開始 3,end message ma 標記原始檔訊息對映的結束 4,on command 將特定命令的處理委派給類的乙個成員函式 5,on contro...