Repost: SetIcon

  • Thread starter Thread starter Egbert Nierop \(MVP for IIS\)
  • Start date Start date
E

Egbert Nierop \(MVP for IIS\)

Igor sorry for not being clear in my original question.

I have a valid handle to an icon control (type = ICON) for a propertysheet,
but when I use SetIcon, either MFC or ATL,
the icon is not displayed or refreshed, neither I get an error.

How can I solve this?
 
Egbert Nierop (MVP for IIS) said:
Igor sorry for not being clear in my original question.

I have a valid handle to an icon control (type = ICON) for a
propertysheet, but when I use SetIcon, either MFC or ATL,
the icon is not displayed or refreshed, neither I get an error.

How can I solve this?

CWindow::SetIcon does a wrong thing - it sends WM_SETICON message. This
is for setting the icon in the top left corner of a top-level window.

I take it you want to set the icon in a static control. For that, you
need to send STM_SETICON message. ATL does not have a wrapper for this
message out of the box - just use SendMessage.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
 
Igor Tandetnik said:
CWindow::SetIcon does a wrong thing - it sends WM_SETICON message. This is
for setting the icon in the top left corner of a top-level window.

Thanks!
THis helps...
 
Back
Top