Windows 2000 introduced a setting for hiding keyboard accelerator keys. If this setting is enabled, the shortcuts are not displayed in underlined font style.
There is no general managed way in .NET Framework 1.1 to show accelerator keys underlined automatically. To do that, a WM_CHANGEUISTATE message with appropriate data must be sent to the window that should show its accelerator keys. One of the parameters passed with the message needs the MAKELONG macro to combine two 16-bit integers to a 32-bit integer. In our sample, we use a trick with a structure to provide an easy and managed way to replace the MAKELONG, LOWORD, and HIWORD macros:
The procedure MakeAcceleratorsVisible takes a controls and makes its accelerator keys visible:
If accelerators should be made visible within a Windows Forms control class, the code below can be used instead of MakeAcceleratorsVisible: