What is the correct return value of the BCM_SETSHIELD message?
It returns the handle of the previous icon (then 0 the first time...)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
What is the correct return value of the BCM_SETSHIELD message?
The documentation at https://learn.microsoft.com/en-us/windows/win32/controls/bcm-setshield states that it returns 1 on success and an error code otherwise, but in my tests it seems to return 0 when successfully setting the shield.
The documentation for the Button_SetElevationRequiredState macro states it returns void, but the actual implementation returns LRESULT.
The documentation for the MFC CButton (https://learn.microsoft.com/en-us/cpp/mfc/reference/cbutton-class?view=msvc-170) states that there is a method CButton::SetElevationRequired that returns BOOL.
But there is no such method. Instead there is a method CButton::SetShield that returns a HICON.
What is the correct return value of the BCM_SETSHIELD message?
It returns the handle of the previous icon (then 0 the first time...)