Broad Network


Button Notification Messages

Windows Predefined Controls – Part 10

Volume - Windows User Interface

Forward: In this part of the series, we look at Button Notification Messages.

By: Chrysanthus Date Published: 29 Aug 2012

Introduction

This is part 10 of my series, Windows Predefined Controls. In order to understand this tutorial, you most have read all the previous tutorials of the series. In this part of the series, we look at Button Notification Messages.

Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at forchatrans@yahoo.com. That is, contact me for the slightest problem you have about what you are reading.

Notification
When a user acts (uses) on a control, that is an event. A message of the event is sent to the window procedure of the parent window. Such a message is called a notification. I explained the details of notifications in a tutorial of this series, titled, “Control Messages”. I now give you a list of Button notifications and their meanings.

Notification Code: Meaning
BN_CLICKED: This message is sent when the user clicks a button. The parent window of the button receives the BN_CLICKED notification code in the form of a WM_COMMAND message.

BN_DBLCLK: This notification code is sent when the user double-clicks a button. This notification code is sent automatically for BS_USERBUTTON, BS_RADIOBUTTON, and BS_OWNERDRAW buttons. Other button types send BN_DBLCLK only if they have the BS_NOTIFY style. The parent window of the button receives the BN_DBLCLK notification code in the form of a WM_COMMAND message.

BN_DOUBLECLICKED:  This notification is sent when the user double-clicks a button. This notification is sent automatically for BS_USERBUTTON, BS_RADIOBUTTON, and BS_OWNERDRAW buttons. Other button types send BN_DOUBLECLICKED only if they have the BS_NOTIFY style. The parent window of the button receives the BN_DOUBLECLICKED notification code in the form of a WM_COMMAND message. BN_DOUBLECLICKED is the same as BN_DBLCLK.

BN_KILLFOCUS: This notification is sent when a button loses the keyboard focus. The button must have the BS_NOTIFY style to send this notification code. The parent window of the button receives the BN_KILLFOCUS notification code in the form of a WM_COMMAND message.

BN_SETFOCUS: This notification is sent when a button receives the keyboard focus. The button must have the BS_NOTIFY style to send this notification code. The parent window of the button receives the BN_SETFOCUS notification code in the form of a WM_COMMAND message.

BCN_DROPDOWN: This code is sent when the user clicks a drop down arrow on a button. The parent window of the control receives this notification code in the form of a WM_NOTIFY message.

That is it for this part of the series. We stop here and continue in the next part.

Chrys

Related Courses

C++ Course
Relational Database and Sybase
Windows User Interface
Computer Programmer – A Jack of all Trade – Poem
NEXT

Comments

Become the Writer's Fan
Send the Writer a Message