BCM_SETSHIELD return value

Jogy 21 Reputation points
2022-06-05T19:09:40.18+00:00

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.

Windows development | Windows API - Win32
0 comments No comments
{count} votes

Answer accepted by question author
  1. Castorix31 91,536 Reputation points
    2022-06-05T19:55:18.13+00:00

    What is the correct return value of the BCM_SETSHIELD message?

    It returns the handle of the previous icon (then 0 the first time...)


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.