A common control notifies its parent window of an input event by sending a notification. Some common controls send notifications in the form of WM_NOTIFY messages. The lParam parameter of a WM_NOTIFY message is either the address of an NMHDR structure or the address of a larger structure that includes the NMHDR structure (for tab controls, list view controls, and tree view controls). Each common control has its own specific set of notification values.
The common control library also provides notification values that can be sent by more than one type of common control. All of the common controls can send the following notifications:
NM_CLICK | The user clicked the left mouse button within the control. |
NM_DBLCLK | The user double-clicked the left mouse button within the control. |
NM_KILLFOCUS | The control lost the input focus. |
NM_RCLICK | The user clicked the right mouse button within the control. |
NM_RDBLCLK | The user double-clicked the right mouse button within the control. |
NM_RETURN | The control has the input focus, and the user pressed the Enter key. |
NM_SETFOCUS | The control gained the input focus. |
Now that you have some background, the remainder of this chapter will explore two of the new common controls: status bars and toolbars. They are referred to as organizational controls because you can use them to organize other controls. Before Windows 95, you could find support for these controls from within Microsoft Visual C++ through the Microsoft Foundation Class Library; all you needed to do was click a check box. But these were MFC classes. C programmers were still out of luck if they wanted easy access to these controls. Now that the Win32 API supports the organizational controls, everyone can use the same status bars and toolbars that appear in the Windows 95 user interface.