(转)无边框窗口实现拖垃效果
(1)實現效果需要處理以下這三個消息:
WM_NCHITTEST WM_SETCURSOR WM_NCLBUTTONDOWN
WM_NCHITTEST參數:
xPos = LOWORD(lParam); // horizontal position of cursor (相對于屏幕坐標)
yPos = HIWORD(lParam); // vertical position of cursor (相對于屏幕坐標)
(2)消息處理函數:
(3)消息返回值
HTBORDER In the border of a window that does not have a sizing border(在一個沒有邊框的窗口邊緣上)
HTBOTTOM In the lower horizontal border of a window(在窗口下面的水平邊緣上)
HTBOTTOMLEFT In the lower-left corner of a window border(在窗口左下方的角點上)
HTBOTTOMRIGHT In the lower-right corner of a window border(在窗口右下方的角點上)
HTCAPTION In a title bar(在標題欄上)
HTCLIENT In a client area(在客戶區域中)
HTERROR On the screen background or on a dividing line between windows (same as HTNOWHERE, except that the DefWindowProc function produces a system beep to
indicate an error)
HTGROWBOX In a size box (same as HTSIZE)
HTHSCROLL In a horizontal scroll bar(在水平滾動條上)
HTLEFT In the left border of a window(在窗口的左邊緣上)
HTMENU In a menu(在一個菜單上)
HTNOWHERE On the screen background or on a dividing line between windows(在窗口和屏幕背景的邊緣線上)
HTREDUCE In a Minimize button(在最小化按鈕上)
HTRIGHT In the right border of a window(在窗口的右邊緣上)
HTSIZE In a size box (same as HTGROWBOX)
HTSYSMENU In a System menu or in a Close button in a child window
HTTOP In the upper horizontal border of a window(在窗口上面的水平邊緣上)
HTTOPLEFT In the upper-left corner of a window border(在窗口左上方的角點上)
HTTOPRIGHT In the upper right corner of a window border(在窗口右上方的角點上)
HTTRANSPARENT In a window currently covered by another window
HTVSCROLL In the vertical scroll bar(在垂直滾動條上)
HTZOOM In a Maximize button(在最大化按鈕上)
?
轉載于:https://www.cnblogs.com/leven20061001/archive/2012/11/15/2771275.html
總結
以上是生活随笔為你收集整理的(转)无边框窗口实现拖垃效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Lucene.net常见功能实现知识汇总
- 下一篇: C++动态数组分配