BN_CLICKED notification code
Applies to: desktop apps only
Sent when the user clicks a button.
The parent window of the button receives this notification code through the WM_COMMAND message.
BN_CLICKED
WPARAM wParam;
LPARAM lParam;
Parameters
- wParam
-
The LOWORD contains the button's control identifier. The HIWORD specifies the notification code.
- lParam
-
A handle to the button.
Remarks
A disabled button does not send a BN_CLICKED notification code to its parent window.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
See also
- Other Resources
- HIWORD
- LOWORD
- WM_COMMAND
Send comments about this topic to Microsoft
Build date: 3/6/2012
Simulating a button click (ON_BN_CLICKED).
This will simulate the IDC_OK button ebing clicked.
WPARAM wParam = BN_CLICKED;
wParam = MAKEWPARAM( IDC_OK, BN_CLICKED );
LPARAM lParam = (LPARAM)GetDlgItem(IDC_OK);
BOOL bval = ::PostMessage(m_hWnd, WM_COMMAND, wParam, lParam);
**
For some reason passing NULL instead of the window handle m_hWnd did not work even though control was certainly on the same window.
-- Ajay
WPARAM wParam = BN_CLICKED;
wParam = MAKEWPARAM( IDC_OK, BN_CLICKED );
LPARAM lParam = (LPARAM)GetDlgItem(IDC_OK);
BOOL bval = ::PostMessage(m_hWnd, WM_COMMAND, wParam, lParam);
**
For some reason passing NULL instead of the window handle m_hWnd did not work even though control was certainly on the same window.
-- Ajay
- 9/16/2011
- Ajay S. Ramachandran