Windows has a number of window styles that corresponds to attributes of a window, and SetWindowLongPtr, used with parameters GWL_EXSTYLE or GWL_STYLE, can be used to toggle these attributes ON/OFF. For example, WS_CAPTION can be used to toggle a window's title bar ON/OFF. I was wondering if there's a window style that corresponds to toggling the class menu of a HWND ON/OFF as well.
Note: I understand that the class menu can be toggled via the SetMenu APIs, but was just curious if there's a corresponding window style as well.
Thanks.
There is no window style, but there is a class value instead.
When a window class is registered via
RegisterClass()/RegisterClassEx(), theWNDCLASS/WNDCLASSEXstructure has anlpszMenuNamemember:You can use
SetClassLong()/SetClassLongPtr()with itsnIndexparameter set toGCLP_MENUNAMEto change thelpszMenuNamevalue for the class used by a given window.