SAMPLE: DefBtn.exe Creates Default Border Around a Push Button

ID: Q48713

The information in this article applies to:

SUMMARY

DefBtn.exe is a sample that demonstrates the correct message sequence to change the status of a push button from the "normal" state to the "default" state. The default push button receives a message when the ENTER key is choosen in a dialog box, no matter which control currently has the focus.

In the DefBtn.exe sample, when a numeral button is pressed ("1", "2", or "3") the corresponding number button ("one", "two", or "three") becomes the default button.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ DefBtn.exe (size: 16797 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

For a button to be correctly activated by using an accelerator, it is necessary to subclass the button to process the focus messages. This is caused by the fact that accelerators bypass some steps in the message flow. Keywords : kbfile kbsample kb16bitonly kbButton kbCtrl kbSDKPlatform kbGrpUser

Last Reviewed: January 3, 1999