создаем любое тестовое диалоговое приложение.
добавляем WindowProc
Проблема:
на WM_NCLBUTTONDBLCLK, WM_NCLBUTTONDOWN всё работает просто замечательно, а на WM_NCLBUTTONUP ведёт себя странным образом. Сообщения не приходят или я что-то там не понимаю.Может быть, кто-нибудь что-то посоветует?
вот выдержки из MSDN:
на NCLBUTTON_DOWN
"The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted. A window receives this message through its WindowProc function."
на WM_NCLBUTTONUP
"The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.A window receives this message through its WindowProc function."
Пример кода:
LRESULT CTestDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_NCLBUTTONUP:
{
// что-то делаем, например
POINTS PS =MAKEPOINTS(lParam) ;
CPoint pt(PS.x,PS.y);
}
break;
case WM_NCLBUTTONDBLCLK:
{
// что-то делаем, например
POINTS PS =MAKEPOINTS(lParam) ;
CPoint pt(PS.x,PS.y);
}
break;
case WM_NCLBUTTONDOWN:
{
// что-то делаем, например
POINTS PS =MAKEPOINTS(lParam) ;
CPoint pt(PS.x,PS.y);
}
}
return CDialog::WindowProc(message, wParam, lParam);
}