CWnd::OnNotify
virtual BOOL OnNotify( WPARAM wParam, LPARAM lParam, LRESULT* pResult );
Parameters
-
wParam
Identifies the control that sends the message if the message is from a control. Otherwise, wParam is 0. -
lParam
Pointer to a notification message (NMHDR) structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member. -
pResult
Pointer to an LRESULT variable in which to store the result code if the message is handled.
Return Value
An application returns nonzero if it processes this message; otherwise 0.
Remarks
OnNotify processes the message map for control notification.
Override this member function in your derived class to handle the WM_NOTIFY message. An override will not process the message map unless the base class OnNotify is called.
For more information on the WM_NOTIFY message, see Technical Note 61 (TN061), ON_NOTIFY and WM_NOTIFY messages. You may also be interested the related topics described in Control Topics, and TN062, Message Reflection for Windows Controls.
from:
구조체 NMHDR ,
- OnNotify 의 인자 lParam 으로 NMHDR 포인터가 전달된다.
typedef struct tagNMHDR {
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR;
////
Note that since the NMHDR member is first in this structure, the pointer you're passed in the notification message can be cast to either a pointer to an NMHDR or a pointer to an LV_KEYDOWN.
Notifications Common to All New Windows Controls
Some notifications are common to all of the new Windows controls. These notifications pass a pointer to an NMHDR structure.
TABLE 1Notification codeSent because
NM_CLICK | User clicked left mouse button in the control |
NM_DBLCLK | User double-clicked left mouse button in the control |
NM_RCLICK | User clicked right mouse button in the control |
NM_RDBLCLK | User double-clicked right mouse button in the control |
NM_RETURN | User pressed the ENTER key while control has input focus |
NM_SETFOCUS | Control has been given input focus |
NM_KILLFOCUS | Control has lost input focus |
NM_OUTOFMEMORY | Control could not complete an operation because there was not enough memory available |
from
CWnd::OnCommand
virtual BOOL OnCommand( WPARAM wParam, LPARAM lParam);
Parameters
wParam
The low-order word of wParam identifies the command ID of the menu item, control, or accelerator. The high-order word of wParam specifies the notification message if the message is from a control. If the message is from an accelerator, the high-order word is 1. If the message is from a menu, the high-order word is 0.
lParam
Identifies the control that sends the message if the message is from a control. Otherwise, lParam is 0.
Return Value
An application returns nonzero if it processes this message; otherwise 0.
Remarks
OnCommand processes the message map for control notification and ON_COMMAND entries, and calls the appropriate member function.
Override this member function in your derived class to handle the WM_COMMAND message. An override will not process the message map unless the base class OnCommand is called.
from:
연관
첫 등록 : 2020.09.24
최종 수정 :
단축 주소 : https://igotit.tistory.com/2624
'VisualStudio.C++.C# > 코딩팁,함수활용,단편' 카테고리의 다른 글
MFC. 드래그 드롭 시 텍스트 안보이는 문제 해결 . 폰트 설정 (0) | 2020.09.26 |
---|---|
C++. Win32 API. MFC. SetCapture(), ReleaseCapture() (0) | 2020.09.25 |
MFC. 컨트롤 동적 생성시 이벤트 핸들링 (0) | 2020.09.24 |
MFC. CListCtrl. 리스트 컨트롤. (0) | 2020.09.24 |
MFC. Understanding CDockablePane. 최고의 설명글. (0) | 2020.09.20 |
댓글