EQuestionAnswers.com Computer/Electronics Questions and Answers
C, C++, VC++, COM/DCOM, DLL and more
#Login #Sign up  Facebook Twitter TGoogle+
 

#Previous question #Index of VC++/WIN32/MFC Questions #Next question

Overview

Mouse non-client area are event names starts with WM_NC (Window Message Non Client). These messages are in same format as mouse client area events. The only difference is these are posted to the window when mouse is interacted in non-client area.

  • WM_NCHITTEST - Mouse non-client area test
  • WM_NCLBUTTONDBLCLK - Mouse non-client area left button double click
  • WM_NCLBUTTONDOWN - Mouse non-client area left button down
  • WM_NCLBUTTONUP - Mouse non-client area left button up
  • WM_NCMBUTTONDBLCLK - Mouse non-client area middle button double click
  • WM_NCMBUTTONDOWN - Mouse non-client area middle button down
  • WM_NCMBUTTONUP - Mouse non-client area middle button up
  • WM_NCMOUSEMOVE - Mouse non-client area x or y movement
  • WM_NCRBUTTONDBLCLK - Mouse non-client area right button double click
  • WM_NCRBUTTONDOWN - Mouse non-client area right button down
  • WM_NCRBUTTONUP - Mouse non-client area right button up
  • WM_NCXBUTTONDBLCLK - Mouse non-client area X button up
  • WM_NCXBUTTONDOWN - Mouse non-client area X button up
  • WM_NCXBUTTONUP - Mouse non-client area X button up

WM_NCHITTEST

Mouse position can be obtained from lparam

xPos = GET_X_LPARAM(lParam); 
yPos = GET_Y_LPARAM(lParam);

WM_NCHITTEST event parameters can be passed to DefWindowProc() which will return a code to know which object is clicked. Here are the return codes from DefWindowProc().

HTBORDER
18

In the border of a window that does not have a sizing border.

HTBOTTOM
15

In the lower-horizontal border of a resizable window (the user can click the mouse to resize the window vertically).

HTBOTTOMLEFT
16

In the lower-left corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).

HTBOTTOMRIGHT
17

In the lower-right corner of a border of a resizable window (the user can click the mouse to resize the window diagonally).

HTCAPTION
2

In a title bar.

HTCLIENT
1

In a client area.

HTCLOSE
20

In a Close button.

HTERROR
-2

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
4

In a size box (same as HTSIZE).

HTHELP
21

In a Help button.

HTHSCROLL
6

In a horizontal scroll bar.

HTLEFT
10

In the left border of a resizable window (the user can click the mouse to resize the window horizontally).

HTMENU
5

In a menu.

HTMAXBUTTON
9

In a Maximize button.

HTMINBUTTON
8

In a Minimize button.

HTNOWHERE
0

On the screen background or on a dividing line between windows.

HTREDUCE
8

In a Minimize button.

HTRIGHT
11

In the right border of a resizable window (the user can click the mouse to resize the window horizontally).

HTSIZE
4

In a size box (same as HTGROWBOX).

HTSYSMENU
3

In a window menu or in a Close button in a child window.

HTTOP
12

In the upper-horizontal border of a window.

HTTOPLEFT
13

In the upper-left corner of a window border.

HTTOPRIGHT
14

In the upper-right corner of a window border.

HTTRANSPARENT
-1

In a window currently covered by another window in the same thread (the message will be sent to underlying windows in the same thread until one of them returns a code that is not HTTRANSPARENT).

HTVSCROLL
7

In the vertical scroll bar.

HTZOOM
9

In a Maximize button.

You have viewed 1 page out of 109. Your VC++ learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

#Programming Windows, Fifth Edition (Developer Reference)
#Programming Applications for Microsoft Windows (Microsoft Programming Series)
#Programming Windows with MFC, Second Edition
#Visual C++ Programming
#Programming Microsoft Visual C++, Fifth Edition

* #1 webmaster Tue 29 Apr/2014 15:34:20(GMT)  Like 0 Unlike 0

Dear Users,

We are pleased to inform you that a forum/blog has been incorporated with www.mybestnotes.co.in. You are welcomed to add your comments, requests, codes, solutions and feedback to it. Please login(if already a member) or signup(for free) to avail to this facility.

Regards,
Webmaster

Your message goes here:

Name:Guest
Email:anonymous@unknown.com
My Post:*
Secutiry Code: ******  *
Preview this compose before posting this in discussion forum.
 
Note:
  1. Use [Sxx] code to show smiles. Example [S02]
  2. Use [URL ], example [URL http://www.google.com/]
  3. To display code or un formatted text use [CODE] [/CODE]. Example: [CODE] printf("Hello world"); [/CODE]
 [S01]   [S02]   [S03]   [S04]   [S05]   [S06]   [S07]   [S08] 
 [S09]   [S10]   [S11]   [S12]   [S13]   [S14]   [S15]   [S16] 
 [S17]   [S18]   [S19]   [S20]   [S21]   [S22]   [S23]   [S24] 

Note: Only members are allowed, * fields are mandatory.