Windows messages wm_command
This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No. Any additional feedback?
In this article. Changes the cursor to a question mark with a pointer. Activates the window associated with the application-specified hot key.
Simulating a menu selection is exactly the same, except that according to the rules above , you set the high-order word of the wParam to zero. Here, hwnd is the window associated with the menu. A window can be associated with a menu either by being created with the menu having passed the menu handle to the CreateWindow or CreateWindowEx function explicitly, or having it done implicitly by including it with the class registration or by having been passed explicitly as the window parameter to a function like TrackPopupWindow.
The button control takes advantage of this pun:. You probably take advantage of this in your dialog procedure without even realizing it. I stated at the start that the accelerator and menu scenarios are just special cases of the control scenario. Since the notification is not coming from a control, the control handle is NULL. Comments are closed. I wrote a book Ground rules Disclaimers and such My necktie's Twitter. The parent window can use these handles to change the button's text and background colors.
However, only owner-drawn buttons respond to the parent window processing the message. The window procedure for the predefined button control window class carries out default processing for all messages that the button control procedure does not process.
When the button control procedure returns FALSE for any message, the predefined window procedure checks the messages and performs the default actions listed in the following table.
The predefined window procedure passes all other messages to the DefWindowProc function for default processing. Skip to main content.
This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? In this article. Disabled gray text in buttons. This color is set to 0 if the current display driver does not support a solid gray color. Returns a handle to the bitmap or icon associated with the button or NULL if the button has no bitmap or icon.
Sets the check state for all styles of radio buttons and check boxes. Associates the specified bitmap or icon handle with the button and returns a handle to the previous bitmap or icon.
0コメント