PRB: Private Button Class Can't Get BM_SETSTYLE in Windows 95Last reviewed: September 29, 1995Article ID: Q130951 |
The information in this article applies to:
SYMPTOMSWhen an application creates a new button class, the new buttons do not receive BM_SETSTYLE messages under Windows 95.
CAUSEIn previous versions of Windows, the new button had only to return DLGC_BUTTON in response to the WM_GETDLGCODE message. This was all that was required to identify the window as a "button." However, in Windows 95, returning DLGC_BUTTON to WM_GETDLGCODE is no longer sufficient to identify the window as a "button." The dialog manager code in Windows 95 is implemented in 16 bits. When a message is dispatched to a 32-bit window, the system automatically generates a thunk. Because the system does not know that the new class is actually a "button," it does not automatically perform the thunk - so the BM_SETSTYLE messages are not sent.
RESOLUTIONTo tell the system to treat the window as a "button," the window must call one of the following APIs at least once: IsDlgButtonChecked CheckRadioButton CheckDlgButton The preferable method for doing this is to call IsDlgButtonChecked during the WM_CREATE message. Once this is done, the window will receive all standard button messages.
STATUSThis behavior is by design.
|
Additional reference words: 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |